asp.net-mvc

How to handle empty URL in ASP.NET MVC

How do you set up the routing to handle http://mysite.com/Foo? Where foo can be any value. I want it to go to /Home/Action/Id where foo is the id. These are the mappings I have tried: routes.MapRoute("Catchall", "{*catchall}", new { controller = "Home", action = "Index", id=""}); routes.MapRoute("ByKey", ...

Proper way to use jQuery in an ASP.NET MVC 1.0 Masterpages

There are a few pages here addressing usage of jQuery with .net masterpages - fewer re: masterpages in MVC in .net MVC apps. But those few seem to be making distinctions re pre-release versions of MVC. Is there now a consensus regarding how and where to include the lib and what potential problems we need to be aware of? It _looks as th...

Cannot figure out something fundamental about ASP.NET MVC (not working simple sample of code included)

Hello everybody. I am trying to learn some ASP.NET MVC. Please bear with me but asp.net mvc is the first mvc framework i ever tried to learn. I do plan to learn more about mvc framework in different languages, but for now i got asp.net mvc. I am fairly good with asp.net forms and love them, but would like to have another asp.net tool...

Ajax Paging - Enable Back Button

Hello, I have a ASP.NET MVC implementation in which I get partial views via jQuery for things such as paging and filtering. The problem is though that I break the browser's back button by doing so. How can I restore back button behavior (rewrite the URL without refresh using pound? Not sure how that works though, and how to re-fetch data...

Images from Database in Asp.Net MVC

I am trying to display the images in my Asp.Net MVC 1.0 application. I can successfully get the Image (into byte[]) from DB. How can I display it into the <img>? ...

Nested server side blocks in ASP.NET MVC?

hey guys, Lately, I'v been struggling with an annoying situation on ASP.NET MVC. Here's the story in short, I'm supposed to have a view that lists all of the products; now because those products are too many, I'm paging them (very innovative heh!). The page contains two paging arrows -"Next 10 products", "and previous 10 products". The...

How do I use an extension method in an ASP.NET MVC View?

How do I access an extension method in an ASP.Net MVC View? In C# I do using MyProject.Extensions; and I remember seeing an XML equivalent to put in a view, but I can't find it anymore. ...

Detecting/handling changed data in ASP.NET MVC / jQuery / JS

We need to universally handle changed data on forms in ASP.NET MVC. Our application has ~100 forms, and the user should be prompted if they start editing a form and click on anything other than Save (i.e. something like "Your data has been changed. Click OK to return to the form, or Cancel to lose all changes."). It looks like SO im...

better way to find controller name from masterpage view in asp.net mvc

is any better way to find controller name from masterpage view in asp.net mvc? thanks achu. ...

CSS file not getting downloaded in Visual Studio 2008 SP?

Hi guys, This might sound a little wierd, but all of a sudden the CSS and Javascript files referenced in my master page are not being downloaded while the page is being rendered. I am working on a ASP.NET MVC project and things were all fine like half an hour ago! Here is what I have in head section of the master page, <link href="/Cont...

Is it possible to build an ASP MVC app without magic strings in views?

I'm very new to ASP .Net MVC, I bought the Pro ASP .Net MVC Framework book from Apress last week and it's proving to be very helpful. The problem that I'm seeing so far is that almost all the example views are riddled with magic strings. I've managed to go through and figure out a few alternatives, but the code starts to get kinda diffi...

quiet bot detection and filtering in ASP.NET MVC

I'm setting up an e-mail form for scientific journal articles. I need to be able to check for bots and filter them quietly. The site run ASP.NET MVC. I'd like to avoid CAPTCHA. Any ideas? ...

Flash XML config file problems with asp.net MVC

I'm creating an asp.net MVC app, first time I've done this. I have a flash component I need to use in a view. I have included the SWF files etc in the Contents folder and referenced it from my view, the flash file loads when you get to the view, great. The problem occurs because the flash file references and XML file for its configurati...

asp.net MVC portals available?

Does anyone know of an asp.net MVC portal that is either commercially available or Open Source? Thanks Update I am defining a portal as a Content Management System where I can develop modules that can run from within the portal. Examples are DotNetNuke, Mojo Portal, Drop Things, Rainbow portal. ...

Will asp.net-mvc ajax related requests count as page views in IIS?

Will asp.net-mvc ajax related requests count as page views in IIS? Does it make a different on the response type of the request? i.e. json versus ... ...

ASP.NET MVC Model List in controller

I'm using ajax and trying to pass the Model back, which is a generic List < T >. I tried Model.ToList() but I don't think I'm going about this correctly. I think it is already setup but I just need to find the method or property name to get the List that was posted, which might not work since my Model from the controller contains a cou...

How do I bind a textbox to a Model parameter in a Strongly Typed View in Asp.Net MVC?

The only way I've seen this done in the tutorials I've looked at, they say to create a new .ascx and choose the option "create" for View Content. I want to be able to customize mine more with specific ID's... So, if I have a Customer that has data: string FirstName, string LastName, string Address. How can I bind my textboxes so that wh...

What is the best or recommended way to upload an image into db in asp.net mvc?

I am working on an application which will store some entities which have name, price, and an associated image into the database? The image will be a byte field? I googled around, most examples involve upload image into server, and store the file path name into the db, is this the recommended way to do this? From my persptive, it seems m...

ASP.NET MVC RenderPartial Handling Client Side IDs

I have taken on an MVC project that has a view that displays several partial views using Html.RenderPartial("ClientDetail", model); Html.RenderPartial("PlanSummary", model); The problem I have is that inside of these partial views, controls with the same id are being generated. Both of the above partial views have this line: Html.Hid...

Gradually posting data to view asp.net mvc

Hi, I am generating lets say a 1000 of records to a database. That means it takes some time. Now, a user can become impatient. So I want to show him a progress bar during the generation process, which happens in Controller. I have found pretty cool progress bars in jquery or flash, but I have no idea, how to use them, since after sending...