asp.net-mvc

Register/Alter MIME associations in asp.net mvc Web Setup Project

I'm making a Web Setup Project of my Asp.net Mvc project. I'd like the installer to change some MIME associations on IIS7. How to do this? ...

Adding Html Action Links to a List in ASP.NET MVC

I'm trying to add a navigational menu for my project which uses the ASP.NET framework and C# programming language. My solution is to create a widget which can populate a partial view when called from the master page. In the widget's action method, how do I add Links or Controller-Action combinations to the ViewDataDictionary? --- Edit ...

hide part of form

Hi, I have an asp.net mvc application where I want to hide/display part of form based on selected line in a dropdown list. This is done by jQuery script: <script type="text/javascript" > $(document).ready(function() { $('#owners').change(function() { $("select option:selected").each(function() { $...

How to implement dynamically changing number of forms in ASP.NET MVC?

I've a Person entity that contains set of "Education" entities. What I want is to collect "N" number of Education entries from the form. This "N" is controlled by "Add More Education Information" and "Remove Education Information" buttons. At the beginning there's an empty form that'll collect one Education entry. ("person" object ,...

get client machine timezone in asp.net mvc

How to get the time zone id (ex.: Central Standard Time) of the client machine in asp.net mvc? ...

IIS6 with ASP MVC Wildcard mapping

Ok, so Im one of the 100's of people having issues getting ASP MVC running on IIS6. I have followed several tutorials including this and this, but still no joy. All I see is the standard IE 404 file not found page. Now in order to ensure that my site is pointing to the correct location I have added a stub index.html file in the root d...

Probable Timeout Issue

If I leave an ASP.NET MVC application for a while then try to access any page, or if I re-compile the application and try to access anything but the root page I get the error of Error executing child request for handler followed by the page path such as 'ASP.areas_accounts_views_contractscontrol_createdatacontract_aspx'. Any ideas as to...

How can I make JsonResult return an array of arrays (without field names) rather than an array of objects?

I have an IEnumerable list of date/value pairs that I am returning as a Json list to flot. However, when I call JsonResult(), the result looks like this: [{"Date":date1, "Value":value1}, {"Date":date2, "Value":value2}...] Flot is expecting [[date1, value1], [date2, value2]...] Is there any simple way to get the MVC framework to out...

How do you build a Single Page Interface in ASP.NET MVC?

Hi all, I want to build a webapplication with a "Single Page Interface", using ASP.NET MVC. I have searched if this was at least possible and I think the answer is: not by simple means (reading http://msdn.microsoft.com/en-us/magazine/cc507641.aspx#S2 second-last paragraph; that article is from May 2008, though). I found other example...

ASP.NET MVC LCID and Sessions

Hi Everyone, i have to short questions on ASP MVC. Where is the best place for setting on Session.LCID ? Thanks ...

ASP.NET MVC - Rewritting FormMethod.Get querystring?

Hello all, I have a simple form with just one textbox and one submit button. The form basically sends to a different page with the value in the textbox as querystring. When I click on the submit button, the querystring is in this format, for example: mysite.com/?TargetCode=Test1 I would like it to display in this format: mysite.com/T...

ASP.NET MVC RequireHttps

How do I use the ASP.NET MVC 2 Preview 2 Futures RequireHttps attribute? I want to prevent unsecured HTTP requests from being sent to an action method. I want to automatically redirect to HTTPS. MSDN: RequireHttpsAttribute RequireHttpsAttribute Members RequireHttpsAttribute.HandleNonHttpsRequest Method How do I use this feature?...

How can I change a url with asp.net mvc?

Hi I am wondering if this can be done easily. I am doing some paypal stuff where when the user returns from the paypal site they go to a "success page" that you set before you send the user to paypal. So now I give my customers 2 choices. They can do a one time payment or they can do a recurring payment. Now with paypal express you ha...

Radio buttons being reset in FF on cache-refresh

(This is technically an addendum to an earlier StackOverflow question I had posted, but my original post asked a different question which doesn't really cover this topic -- I don't want to edit my older question as I feel this is different enough to merit its own page) While browsing my website in Firefox 3.5 (and only FF3.5), I come ac...

Best practice on where to include javascript runtime dependent code in ASP.NET MVC apps

Hi there, I have some javascript code that has in it localized messages that i pull from my resource files. My problem is that if i include my javascript files like... <script scr="..." type="text/javascript"/> in my masterpage for example, then the <%= Resources... %> code is not running on view rendering. My current way of resolvi...

What's the best way to fill POCOs with dummy data?

I have a bunch of POCOs that all relate to each other in a big tree. For example, this is the top-level element: public class Incident : Entity<Incident> { public virtual string Name { get; set; } public virtual DateTime Date { get; set; } public virtual IEnumerable<Site> Sites { get; set; } public Incident() { ...

A bug in the routing engine for .NET?

Hi guys, I have an ASP.NET MVC application. In the application, I have a bunch of similarly structured routes for different actions: /Admin/Addresses/{AddressId}/Delete /Admin/Phones/{PhoneId}/Delete /Admin/Notes/{NoteId}/Delete /Admin/Files/{FileId}/Delete None of which work... I have been checking the routes and the actions for 5 ho...

How to clear the post data for a textbox in an ASP.NET MVC application?

By default, a textbox rendered using <%= Html.TextBox("somefield")%> uses the value from the post data, e.g. if you have validation errors on your page, the value is retrieved from the posted data and used for the value attribute. Now, in a few cases I want to be able to clear that value, in other words I want the textbox to be blank, I...

Recommended structure for testing Javascript with QUnit in ASP.NET

I have a standard ASP.NET MVC (version 2 preview 2) solution with the actual project and server-side unit tests in separate projects. Because this project is very client-side heavy, I want to make a ClientTest project as well that uses QUnit to test the main project. I've thought of creating a regular ASP.NET webforms project with a ...

When hosting an azure MVC app, my web.config's appSettings collection is empty

Using MVC 1.0, and Azure July 2009 SDK I have an MVC application that appears to be working in the azure test framework, except for the fact that my appSettings collection is empty when running there. (But if I just run the web project on it's own, it's fine.) Is there something special I need to do to access the web.config from Azure...