asp.net-mvc

Ajax model binding of a complex type

I am trying to do something along the lines of the following where I have a Controller with an method similar to: public ActionResult Insert(Author author) { //do something... } Where the Author type looks like: public class Author { public string FirstName { get; set; } public string LastName { get; set; } public Book[] Book...

Asp.net Mvc2 LabelFor and DisplayName from prop

Context => ${Html.CheckBoxFor(x => x.Foos[i].Checked)} ${Html.LabelFor(x => x.Foos[i].Checked)} Problem is - i can't provide label text based on Foo.Name. Is there out of the box method of how to modify metadata, passing in lambda x=>x.Name to change it? Is creating another HmtlHelper extension method LabelFor(this htmlhelper, [...

ASP.NET MVC 2 strongly typed htmlhelper, indexes

public class Foo { public bool Checked {get;set;}} View: <viewdata model="Foo[] fooList" /> <for each="var f in fooList"> ${Html.CheckBoxFor(x=>x[fIndex].Checked)} </for> Will output: <input id="Checked" name="Checked" type="checkbox" value="true" /> <input name="Checked" type="hidden" value="false" /> <input id="Checked" name...

control toolkit for asp.net mvc

hi, Is there a good enough Control toolkit framework for ASP.net MVC that includes useful controls like calendar, tree, grid etc. Thanks in advance. ...

Run login page of a ASP.net MVC Azure cloud application on different port than other pages.

Hi folks, Is it possible to run login page of ASP.net MVC Azure cloud application on different port than other pages in the same application ? For example--> Login page - on port 443 Other web pages - on port 80 Thanks, Kushal ... ...

Is it possible to intercept ProcessRequest to determine forms timeout before GetControllerInstance is called?

In an ASP.NET MVC application when using a custom Dependency Injection container (in this case, Unity), is it possible to intercept a request before GetControllerInstance is called to determine if forms authentication timeout has occurred? I have the following in web.config: <authentication mode="Forms"> <forms loginUrl="~/Home/Index...

ASP.NET MVC Paginated List Example

Possible Duplicates: How do I do pagination in ASP.NET MVC? Paging search results with asp.net MVC Can anyone point me towards a canonical ASP.NET MVC paginated list example? ...

Use of "stores" within a web application

I see heavy use of "store" objects in the web app I am working on. Is there a name for this pattern and would you say these types are in the BLL or DAL? These stores contain fragments of what I would consider a classical DAL type, associated with a single type. For example, we have a TabStore containing methods for the persistance and...

Link to Homepage is forwardslash

Im have the default routing and write a link to the Homepage in my view <a href="<%=Url.Action("Index" ,"Home")%>">Link</a> The generated content is a forward slash. <a href="/">Link</a> This link works in Firefox but in IE8 no request is sent to the server when the link is clicked. Is a forward slash a valid content in a link? ...

Getting current action name from partial page

I'm using a custom HtmlHelper in a partial page. Example: /Home/Index - Is the Main Page with Index View /Home/Partial - Is the Partial Action with Partial - A Partial View In the Index view: Html.RenderAction("Partial"); In the Partial View: I'm using a custom htmlhelper in the that htmlhelper I need to get the url of where the ...

ASP.NET MVC ModelState with GET/POST methods and try-catch blocks

Hey everyone, I am having some problems getting the MVC modelstate working with a login process on a website. I have a typical login screen with fields for a username and password. The Account Controller has 2 methods to handle logins. The first is a Get method called "LogOn()" that just returns the login view (which is the username/pw)...

asp.net mvc: SQLDateTimeOverflow problem with Entity Framework

I'm trying to update an object, and getting: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. There are two fields in the object that are DateTime objects, and they're set with: obj.created_date = DateTime.Now; obj.modified_date = DateTime.Now; Except that everything looks reasonable when ...

Render view to string outside controller?

Is it possible to render a view from a class, which is not controller? For example, I'm having a class which will return some data, like controls, which i want to derive from my view. Is it possible? Thanks in advance. ...

A PHP web developer comfortable with C# .NET wants to learn ASP.NET but confused with ASP.NET MVC & Webforms

I'm a decent level PHP web programmer with enough real world experience. I'm also a decent level C#.NET developer. So, I don't want to learn the basics of web development. I also don't have to learn C#. Now I want to start with ASP.NET. I don't know even a,b,c's of ASP.NET. I mean don't even know things like what do I need to setup for ...

NHibernate - Lazy-Loading primitive type

I'm using NHibernate to load some objects into my ASP.NET MVC application. For example, a submission is submitted by a user, and I want to display the username (but only the username) of a user, like this: <%= Html.Encode(item.User.UserName) %> When I load a submission using NHibernate, the User is lazy-loaded from the database, whic...

technique to support urls with https between local and live development

When I deploy my application, certain urls have to be https. How can I develop locally and deploy, while being able to support urls that have https? Is the only way wrapping the url with a function, that determines if you are local or live? (this is a .net mvc app) ...

ASP.NET MVC terminology is tripping me up - why 'ViewModel'?

I'm an ASP.NET MVC newbie, but have used many Model-View-Controller frameworks previously. I recently came across the convention of gathering up the pieces of data that your particular view needs (indeed, it's assigned to the ViewData) into a new class called (NameOfView)ViewModel. Gathering up this data so that it's associated with th...

End user add values to a dropdownlist?

I'm populating a dropdownlist in c# asp.net-MVC from a SQL table using Linq2Sql. I'd like for the user to be able to enter something that isn't in the list into the drop down and have it add to the table. Is this possible? ...

Can a route prefix a controller's name? issues with urls and controller name collisions

I want my urls structure to be like this: www.stackoverflow.com/order/... www.stackoverflow.com/admin/order/... Now both of the above are using different controllers. /controllers/ordercontroller /controllers/admin/ordercontroller Is there a way that I can have this url structure? I was thinking if I could do this: /controllers/...

Why does MvcHttpHandler is mapped from *.mvc?

By default the web.config file for MVC project have the following element: <handlers> <remove name="MvcHttpHandler"/> <add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler"/> </handlers> My problem is that my site returns 404.14, after knocking out all the usual ...