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...
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, [...
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...
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.
...
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
...
...
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...
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?
...
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...
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?
...
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 ...
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)...
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 ...
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.
...
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 ...
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...
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)
...
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...
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?
...
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/...
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 ...