asp.net-mvc

Asp.Net MVC - Linq Sorting Question

I have a MVC application that I'm near completing. But I have a situation that cannot figure out the syntax for. What I want to do is to sort on two columns When I use the syntax below, it sorts by one column, then the next. public IQueryable<vw_FormIndex> FindAllFormsVw(int companyIdParam) { return _db.vw_FormInd...

Is There An Equivalent to redirect_to :back in ASP.NET MVC

Is there an equivalent to Ruby On Rails' redirect_to :back in ASP.NET MVC? What about after submitting a form? For example: From page1 user clicks a link to page2. Submits a form on page2, then I want to redirect to page1. This works great if I hard code the redirect to go to Page1. However if the user clicks a link to page2 from pag...

am i using asp.net mvc correctly?

so after a few weeks, i have got my head around asp.net mvc and have converted two webforms sites over. In addition to just the port, did some refactoring to have clean seperate of model, controller and view code. One pattern that i see that i think still needs improvement is the following and i would like advice or feedback on these ...

Setting up my MVC project on IIS 6

I am very new at web development in general and I am trying to publish my first web app. I am using ASP.Net MVC 1 and IIS 6. I have read the post http://stackoverflow.com/questions/628236/how-to-make-asp-net-mvc-work-in-iis-6 and Phil Haack's blog post at http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx. How...

UpdateModel in asp.net MVC to bind arrays?

I have the following code: var obj = new { site = new int[]{} }; UpdateModel(obj, new string[] {"site"}, form.ToValueProvider()); Now when debugging, the form.ToValueProvider() object has a site key in there with some sites that get populated on postback (from a checkbox form with each checkbox...

Ajax (calling web service) with MVC

I have an asp.net mvc application and i need to to use ajax in this application , i need to add a scriptmanager and add a service refrences with the path of a web service and then call the web service from tag . I have the following code and it doesn't see the web service : <form> <input id="SubmitBtn" type="button" value="Sumbit" oncl...

How can I make xVal work with my extended Html.ValidationImage?

I have extended the ASP.NET MVC Html Helper to include my own ValidationImage that outputs an image rather than the standard tags. Details are shown within the StackOverflow Question: How do I extend Html.ValidationMessage so that I can include an image as the error? I would like this to integrate well with xVal now. What would be th...

Who need to save data in session

Hi, i build a small application with asp.net mvc framework. I have one question. I built n-layer structure (controller -> service layer -> repository layer) of app and created a wizzard for collect data from user. Some data which comes from repository(data layer) need to save for next step(for example when user press back button on wizza...

Has anyone used Steve Sanderson’s MvcIntegrationTestFramework?

I was looking into additional ways to test ASP.NET MVC applications and ran into Steve Sanderson’s MvcIntegrationTestFramework. The approach looks rather promising but I was wondering if anyone had any actual experience to share. ...

Nerd Dinner returns 404s for all sub-pages

I just got a new Windows Server 2003 machine and I've been trying to get Nerd Dinner onto it. The server already has .NET 3.5 SP1, ASP .NET MVC, etc. When I upload Nerd Dinner via FTP to a subdirectory of the main webpage, I get a 404 when I go to any page in the site except for the root and the home page doesn't event show the map. Fo...

receive Multiple values with MVC action method from Multi Select listbox

Hello, I am rather new to MVC. I am trying to post data (An array of type "SurveyAnswer") to a MVC action method from an HTML form. Everything works fine with I pass back data from a html input that has a single value, such as a Html.TextBox(), but when the html input has multiple values such as Html.ListBox(), the action method in my ...

Access HtmlHelpers from WebForm when using ASP.NET MVC

I am adding a WebForm from which I would like to resolve routes to URLs. For example, in MVC I would just use return RedirectToAction("Action", "Controller"); So, if you have a way of getting to that same URL from a WebForm in the same application, it would be appreciated. ...

How do you ignore/persist values in MVC when your view-model doesn't have as many fields as your domain model?

I have a site where I'm using fluentNhibernate and Asp.net MVC. I have an Edit view that allows user to edit 8 of the 10 properties for that record (object). When you submit the form and the Model binds, the two un-editable fields come back in the view-model as Empty strings or as default DateTime values depending on the type of proper...

asp.net mvc error -can't find default page

i have been working on an asp.net mvc site for a week and out of the blue i cant run the site. suddenly i get this error: The view 'Index' or its master could not be found. The following locations were searched Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace f...

ASP.NET MVC Model Binding Related Entities on Same Page

This problem has been driving me crazy for several hours now... In my domain, I have 2 entities that are related to each other Sku and Item. Each sku can have many items. public class Sku { private readonly EntitySet<Item> items; public Sku() { items = new EntitySet<Item>(AttachItems, DetachItems); } public...

asp.net mvc - site works fine locally but not after deployment

i have an asp.net mvc website. http:/mywebsite.com (just for this example) I have been testing this asp.net mvc website locally on my machine and everything works fine on my local machine during testing. When i deploy to my web server when i bring up http://mywebsite.com it goes to HomeController and load the view Views/Home/Index.a...

Debug into asp.net mvc source code?

Have you tried to debug into asp.net mvc source code? I have a project and I want to link to asp.net mvc source code instead of the compiled dll in the GAC. I also have another validation library (xVal) which also uses the asp.net mvc dll. It seems that if I just replace my reference to asp.net mvc dll with the asp.net mvc project, the...

2 asp.net mvc sites conflicting with each other

i have deployed an asp.net mvc site a few days ago and everything is going fine. I just deployed a second website (totally unrelated) i just went to the first website and i am now getting an error below. Can anyone help me determine what is going on. I dont understand why they would know anything about each other. The controller nam...

ASP.NET MVC | How to deal with password confirm value?

What's the best way to validate password and confirm password fields in a strongly-typed view? Password Field Code: <label for="BaseUser.PasswordHash">Password</label> <%= Html.Password("BaseUser.PasswordHash", Model.BaseUser.PasswordHash)%> <%= Html.ValidationMessage("BaseUser.PasswordHash", "*")%> I don't know how to deal with conf...

Multiple consumers, single data provider - Too Early For RIA? Options?

I have a few projects coming up that have a number of endpoints or clients that can hit the same data. For instance a site might have... A asp.net MVC based end user facing website A web based adminitration back end that can allow specific, limited updates from some users in situatiosn where a full client isn't useful (mobile web etc) ...