asp.net-mvc

New to ASP.NET MVC - Will I have to relearn security?

Hi, I'm planning work on a new project and am now tempted to use ASP.NET MVC. My project plans to use JQuery and AJAX (although non-JS clients will also be supported). Coming from a standard ASP.NET background, I'm still trying to get my head around the MVC paradigm (with great help from Scott Guthrie). However, my main concern with us...

Please Help, Unable to access the text in MVC dropdown list on POST

Hi I have a MVC dropdown list (Html.DropDownList) with list of Movies populated. I want to retrieve both Title(value field), Description(Text field) when I perform the form Submit. I can access the Title(value field), but I can't access the description. My code sample is below. //View Model....... public class Cinema { public s...

Is there a quicker/better way to get Methods that have attribute applied in C#

I have a marker interface something like this: [AttributeUsage(AttributeTargets.Method, AllowMultiple=false, Inherited=true)] public class MyAttribute : Attribute { } And i want to apply it to methods on different classes in different assemblies... Then I want to Get a MethodInfo for all methods that have this attribute applied. I ne...

Cookie being reset / wiped out

I have developed a web app using asp.net mvc. I've deployed it onto the server and experiencing a problem I didn't get when developing the website locally. When I log into the website I navigate through and its fine. However if I leave it a while then try and navigate again I am logged out and redirected to the login page. I'm using th...

ASP.net MVC demo projects that use View Models

Hey guys Just wondering if there are any good projects out there that use View Models. I am trying to get my implementation nailed down for how we are going to use VM's and there seems to be a few cross roads that I am coming up to and am wanting to see how other people handle these. Big bonus if the project uses ASP.net MVC 2.0. Che...

ASP.net MVC: Creating SelectList in the view or action?

Hey guys I'm just wondering where people are creating their SelectList - in the action or the view. I have seen examples of both and the one that makes the most sense to me is doing it in the action and have the view model have a property of type SelectList. On the other hand, I have seen examples where people have the view model h...

Does this approach to using ELMaH with MVC smell?

I've been looking around for some approaches to using ELMaH with ASP.Net MVC so that I can use the custom error page for all exceptions including 404s. There is no shortage of questions asking how to get the /Shared/Error.aspx working correctly in ASP.Net MVC - either with or without ELMaH. I haven't had a problem with that task, but I...

How to use textile.net

Well, i've search all around but there are no document neither on google nor on textile.net codeplex, and also no code comment about functionality. So I just want to post a question so that people like me, as well as other people who don't know how to use textile.net will just refer to this article. How to use Textile.net? refer answer...

trying to do asp.net mvc development from vmware fusion

the issue is that my source is hosted on the host machine (in this case a mac book pro) and visual studio wants to be able to monitor the web.config for changes so it is throwing the error: An error occurred loading a configuration file: Failed to start monitoring changes to: \path\to\web.config I have tried to add the HKLM\Software\As...

Websites & Web Application using asp.net mvc..

I was wondering if people could post some examples of interesting websites and web apps that were built with asp.net mvc? Stackoverflow.com - Programming Q/A Codeplex.com - Open Source Project Community and other stackexchangesites... Any others.... ...

Is it possible to make the AntiForgeryToken value in ASP.NET MVC change after each verification?

We've just had some Penetration Testing carried out on an application we've built using ASP.NET MVC, and one of the recommendations that came back was that the value of the AntiForgeryToken in the Form could be resubmitted multiple times and did not expire after a single use. According to the OWASP recommendations around the Synchronize...

how to apply css class to the root folder?

How shall I apply Css Class to the root folder of my mvc application.Because when the application is not given the name of the controller and the start action it is not displaying the images and the css ...

ASP.NET MVC 2 RC 2 "Wizard" for whole model validation

There is a good simple solution for a multi-page "Wizard" control in MVC here: http://www.highoncoding.com/Articles/647_Creating_Wizard_Using_ASP_NET_MVC_Part_1.aspx http://www.highoncoding.com/Articles/652_Creating_Wizard_in_ASP_NET_MVC_Part_2.aspx The model is populated in several steps and a hidden field is used to persist data bet...

Calling a different action from view using jQuery Ajax fnc

My view url is /Customer/Detail/1 I'd like to update a div element in this view, but I cannot reach the action method.I'm using jQyery like this: $.ajax({ type: "POST", url: "List", data: formData, success: function(newHtml) { setTimeout(function() { $...

Redirect user back to the original page

I have an edit page which is used from different sources. After editing I would like to redirect user to original page. Earlier I used ID (given as a parameter) and Action (hard-coded) to redirect user to certain page, but problems occurs when many different pages can access the same edit page. Any suggestions how to handle this situati...

ModelState.AddModelError on form level with ASP.NET MVC 2 RC

In the previous versions on ASP.NET MVC, you could use ModelState.AddModelError("_FORM", "error") to make an error on the form-level instead of a property-level. This seems not to work anymore with the new RC of ASP.NET MVC 2. Is there another way how to do it? I use <%= Html.ValidationSummary() %> at my View-file... ...

ASP.MVC 1.0 Checkbox values with ViewModel and for specific ID

All, I've read through a lot of posts about Checkboxes and ASP.MVC but I'm not that much wiser. My scenario: I have a strongly typed View where I pass a collection of summary objects to the view for rendering in a for-each. This summary object contains label data based on a unique id. I also add a checkbox to the row so do so via: <...

ASP.Net MVC On IIS6 default.aspx

Hi I am having an issue where when deploying an MVC site onto an IIS 6 server the url schema is broken. I have followed all the examples for getting IIS 6 to work with MVC and this seems to be ok. The problem is that on all of my IIS 6 request the /default.aspx is being appended to the url. Here is an example using the Route Tester de...

Html Attribute for Html.Dropdown

I am using a dropdown list as follows. <%=Html.DropDownList("ddl", ViewData["Available"] as SelectList, new { CssClass = "input-config", onchange = "this.form.submit();" })%> On its selection change I am invoking post action. After the post the same page is shown on which this drop down is present. I want to know about the HTML a...

Asp.net mvc can not work without App_Data

I'm using a custom security (no membership provider). After the user logs in ... a folder "App_Data" with ASPNETDB.MDF gets automatically created ... on my local machine. If I deploy this to a remote server, it will not work due to security constraints on App_Data. Even if I delete this folder and restart the application ... it is re-cr...