asp.net-mvc

Where is the right version of MicrosoftMvcJQueryValidation.js for MVC 2 beta 2?

MicrosoftMvcJQueryValidation.js is used by ASP.NET MVC 2 for client side validation. Having problems with this file just not working properly and wondering if I have the wrong version. The version I am using came from the source for futures. MicrosoftMvcJQueryValidation.js 5,626 bytes 11/17/09 10:43:12am There are two reasons i t...

ASP.NET MVC: How to maintain TextBox State when your ViewModel is a Collection/List/IEnumerable

I am using ASP.NET MVC 2 Beta. I can create a wizard like workflow using Steven Sanderson's technique (in his book Pro ASP.NET MVC Framework) except using Session instead of hidden form fields to preserve the data across requests. I can go back and forth between pages and maintain the values in a TextBox without any issue when my model i...

can I have more than one route per action on select parameters?

my action has two 3 parameters, but only two are called at a time. So I want to do this: People is the action, string Height, string searchHigh, sting searchLow /Groups/People/Tall/searchHigh and this /Groups/People/Short/searchLow i map both and the first route works, but the second gets appended to the first when go to the sho...

ASP.NET MVC with NHibernate

I want to know few things about ASP.NET MVC with NHibernate. Is NHibernate the best ORM used with ASP.NET MVC? If so, will NHibernate slow down the application? What can be done to improve performance of an ASP.NET MVC application with NHibernate? ...

update the Model value in the code before it gets Validated

I'm using DataAnnotation for validation. The Post for Create Action returns Model accountElement, and one of the field is AccountID which is required and is Validated using Dataannotation. In the Post Action for create I'm hard wiring the AccountID value to 1 (accountElement.AccountID = 1; code below) and then I use TryUpdateModel. Sh...

how to read data send from renderpartial

in my index.aspx page i have something like: <% int tid = Convert.ToInt32(ViewData["TemplateId"]); Html.RenderPartial("/Views/Templates/MyModule.aspx", tid); %> how to read tid in MyModule.aspx using javascript pls help thanx ...

MVC: How to refresh a view

Hi there, In my controller class I return some data to my view and it's all good. Can i do something like this? public ActionResult List() { while (true) { Thread.Sleep(3000); return View("ListStatus", data); } } Of course the above code won't work as when the return st...

Binary Operator Equal is not defined... troubles comparing MemberExpressions in a generic repository

I have a generic SelectAllByKey method in my repository: public IList<E> SelectAllByKey(string columnName, string key) { KeyProperty = columnName; Expression rightExpr = null; rightExpr = Expression.Constant(key); // First we define the parameter that we are going to use the clause. var ...

ASP.NET MVC: Get all controllers

Is it possible to get all controllers available to a ControllerFactory? What I want to do is get a list of all controller types in application, but in a consistent way. So that all controllers I get are the same ones default request resolution is using. (The actual task is to find all action methods that have a given attribute). ...

Secure single mvc page

i have an asp.net mvc application that has authentication set to none in the web.config but would like to secure one view with windows authentication. is there any easy/good way to do this without changing the authentication configuration? ...

MVC open pdf file

Hi, I have the following issue: I have a MVC application, in some action of some controller i'm generating a PDF file, the file is being generated on a specific path on the server. That action is being called on an action link of the view, when the user clicks that link, the action generated that PDF, everything fine until here. I want t...

Windows Azure WebRole stuck in a deployment loop

I've been struggling with this one for a couple of days now. My current Windows Azure WebRole is stuck in a loop where the status keeps changing between Initializing, Busy, Stopping and Stopped. It never goes live, and I can can never see the website as a result. The WebRole is an "out of the box" MVC 2 application with Copy Local set t...

ASP.NET whitespace or %20 in URL

Good day, everyone. I found strange behavior within ASP.NET engine when it handles non-existent URL with whitespace. When we have normal URL like this one: http://stackoverflow.com/questions/tagged1/c%23 we get normal custom 404 page as was intended by developers (if any). But here's the bug. Just add some white space like this:http:...

Logging custom actions in asp.net mvc using built-in forms authentication

Hello, I am using the built-in forms authentication that comes with asp.net mvc. I added all the necessary tables to Sql Server using aspnet_regsql wizard and I have it all integrated and working perfect. Now I can add users, log in, perform control Authorization and all these things. The next step is to add some basic logs when a user...

ASP.NET MVC - Master / Detail Posting

Hello, I am new to ASP.NET MVC. I am trying to create what I thought was a basic functionality. I have a view that is accessed via "http://myserver.com/Products/Ship/". When a user visits this page, they will be prompted for the serial number of a product. After a user enters the serial number and clicks "next", I want to show them a dr...

What's the meaning of "_FORM" in ModelState?

Hello, I was going through the AccountController class (the default one). I noticed that "_FORM" is used at many places with the ModelState. For, isntance: if (String.IsNullOrEmpty(userName)) { ModelState.AddModelError("username", "You must specify a username."); } if (!String.Equals(password, confirmPasswo...

Using arguments in MVC

I've got an ASP.NET MVC site up and running, but need to make one slight change to it - but don't know how to approach it. I've got a URL that looks like http://server/Oracle/Details/234342 - which displays information about customer number 234342. Now I want to change the URL to this: http://server/Oracle/Details/234342?debug=1. I wa...

User controls in ASP.NET MVC

I am loving MVC but can't see to understand how your meant to implement User Controls. If I have a Multiple views each with shopping basket details how can I encapulate the shopping basket view and code so I don't have to return the basket data with each controller viewdata? ...

Rendering partial views with a model and htmlhelper

ASP .NET MVC 1 I'd like to show a partial view base on a model, and I'd like that to have a fairly short command for that. So I saw a way of using both a HtmlHelper and a controller (And I'd use another controller for that, not the controller currently used). But somehow it still gives an error, though I think the method starts to look...

In ASP.Net MVC, can ModelState be used with an ajax update?

This is a follow up to a previous question that I had before about passing an error back to the client, but also pertains to the ModelState. Has anyone successful used the Nerd Dinner approach, but with Ajax? So Nerd Dinner does an update as so. [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(int id, FormCollection formValue...