asp.net-mvc

Custom ASP.NET MVC validation summary for address fields

I'm trying to figure out the best way to validate a one page checkout. It contains : ship address billing address etc. the Address class obvious contains First Name, Last Name, Street1, Street2, City, State, Zip, Phone etc. Lets say the user clicks 'OK' before entering anything - then you end up with a dozen or more validation error...

[ASP.NET MVC] What would cause a partial view to suddenly not be found?

I'm baffled. My site randomly throws the following error: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: The partial view '/SiteUserMenu' could not be found. The following locations were searched: /SiteUserMenu at System.Web.Mvc.HtmlHelper.Fi...

Will My Dispose Methods Get Called at End of ASP.NET Request

I have a lightweight class I use to keep keep track of who the user is in an ASP.NET MVC web request. It retrieves a dictionary from application cache and reads and modifies some values, and at the end of each method where the cached dictionary is accessed, inserts the dictionary back into cache. I would like to just be able to modify t...

get route name in ASP.NET MVC

I'm using this code in my view to enumerate routes but I am unable to get route names from Route object. RouteCollection routes = RouteTable.Routes; foreach (RouteBase rb in routes) { Route route = rb as Route; So how can I get access to route name? ...

S#arp Architecture many-to-many mapping overrides not working

I have tried pretty much everything to get M:M mappings working in S#arp Architecture. Unfortunately the Northwind example project does not have a M:M override. All worked fine in my project before converting to S#arp and its choice of Fluent NHibernate's Auto mapping. I like the auto-mapping, it's good, however the overrides do not se...

unit of work and session per request in nhibernate and asp.net mvc

Hi There I have been using the ncommon framework (http://code.google.com/p/ncommon/) with nhibernate and asp.net mvc. I really like the implementation of the unit of work pattern, but am having problems with lazy loading in my views. I am looking how to implement the session per request pattern with ncommon or look at another framework ...

ASP.NET MVC Forms authentication and unauthenticated controller actions

I have a ASP.NET MVC site that is locked down using Forms Authentication. The web.config has <authentication mode="Forms"> <forms defaultUrl="~/Account/LogOn" loginUrl="~/Account/LogOn" timeout="2880"/> </authentication> <authorization> <deny users="?"/> </authorization> None of my pages other than Account/LogOn can be viewed unless...

how can i call a controller action directly from a javascript function . .

I have the following code that shows a jquery ui dialog form with data for the user to enter: $("#dialog").dialog({ bgiframe: true, autoOpen: false, height: 300, modal: true, buttons: { 'Create an account': function() { var bValid = true; ...

StructureMap/NHibernate Session Per Request including constant transcation

Hi, I just started using StructureMap in my MVC apps, and everything goes fine, excepts handling my ITranscation the correct way. What I want to do is create a new ISession on each request. Together with this I want to start a transcation. On the end of the request I will commit the transcation. My question is, how can I do this the...

can you load a new page into a jquery ui dialog with asp.net mvc

i have a regular html Grid and i am binding my asp.net mvc view to a strongly typed array called MyObject[]. MyObject has 40 properties but i only populate 10 of them because that is what is shown on the main grid. this is in the index view. i want to add a column to my grid to have a link that says "Edit Details". this would bring u...

HTML Helpers and Partial Views

If I have say a Partial View called MypartialView and I have a HTML Helper called "MyHTMLHelper" how can I return a partial view from the helper? My requirement is that sometimes I'd like to render a PartialView on it's own and other times I'd like to render it with another partial view, or a slab of text or something. So I thought I c...

How Can I Stop ASP.Net MVC Html.ActionLink From Using Existing Route Values?

The website I'm working on has some fairly complicated routing structures and we're experiencing some difficulties working with the routing engine to build URLs the way we need them to be built. We have a search results page that uses RegEx based pattern matching to group several variables into a single route segment (i.e. "www.host.com...

ValidationMessageFor is missing from ASP.NET MVC VS 2010

I have installed VS 2010 and created a new MVC application with it. I have looked in the futures library as well as the source code from Code Plex and I can see that the function is in the ValidationExtensions class in the source code from Code Plex. Does anyone know how to get the source code from code plex to install with VS 2010 or ...

does jquery .post or ui dialog have a "please wait . ." icon option?

when i click on a link, i have a jquery .post call in a javascript function. This calls a controller action which returns a partialresult into a jquery ui dialog. this process can take a few seconds as the controller calls the model for some calculations, etc . . anyway, is there anyway to display a "Please wait . ." or animated icon ...

asp.net-mvc html helper library

There seems to be an abundance of jQuery plugins that you can grab and use quite easily. Does anyone know of any html helper samples, examples or libraries that you can also download and use. In particular I'm looking for free helpers. :) I know helpers can be specific to applications but it'd be great to see what others are doing. ...

JQGrid url action not firing when using Ajax.BeginForm

Fires the action when I'm using Html.BeginForm but not Ajax.BeginForm. Anyone know why? ...

why does my site take so long to load?

Hi Here the problem. I have my site hosted on a shared hosting for asp.net mvc. I login and say and fill in one of my forms in and want to submit it. The submit is done using jquery ajax request. Now all of a sudden it will hang and won't do something for like 20 seconds then all of a sudden it will finish my request of saving the fo...

render .ascx page into .aspx page using javascript, jquery

i have aspx page which has following js function which is called on button click enter code here <input type="button" onclick="calltemp1()" value="Temp1"/> <script type="text/javascript"> function calltemp1() { $("#Renderthisdiv").load("/Views/Templates/_Temp1.ascx"); } </script> ...

use ajax 4.0 in mvc to create multiple templates

consider following code i have used ajax 4.0 with MVC framework <script type="text/javascript" src="/scripts/MicrosoftAjax.js"></script> <script type="text/javascript" src="/scripts/MicrosoftAjaxTemplates.js"></script> <div id="divdata" class="sys-template" > <p>Event Title:<asp:TextBox ID="TextBox1" runat="server">{{ title }}</asp:...

How to pass controller's ModelState to my service constructor with Autofac?

I have a wrapper on ModelStateDictionary which all my services accept. Is it possible to configure the autofac to inject the controller ModelStateDictionary into the constructor of the wrapper and then inject it into service constructor? //code public class ModelValidation : IModelValidation { public ModelValidation(ModelStateDictionar...