How can I exclude multiple columns when creating a new customer? The other column is the date that the record was created - called customer_dt.
public ActionResult Create([Bind(Exclude = "customer_id")] Customer customer)
{
/* Do something here ... */
}
...
Hi All,
I'm a total noob, so forgive me in advance if there's something very obvious I'm missing here.
I'm working on refactoring some Web applications from ColdFusion to ASP.NET MVC 2. I'm trying to create a radio button list based on this article:
http://stackoverflow.com/questions/2512809/has-anyone-implement-radiobuttonlistfort-f...
I'm just starting on my first ASP.NET MVC project (it's actually extending an existing MVC project that uses 4.0 and Linq2SQL). What I'm looking for is a way to create an instance of a model every time a different model is created (i.e., saved to the database). I see an OnCreated() method in the generated code, but that's in a partial cl...
I have a for loop to loop through my list of SliderItems which contain an ID, ImageUrl, and a link Url.
<% foreach (var item in Model) { %>
<a href="#"><img id="<%: item.ImageID %>" src="<%: item.ImageUrl %>" class="slide" alt="" /></a>
<%} %>
I need to loop through and generate the data parameters for this javascript automatical...
I just learned about XSL and XSLT a few days ago and now I'm trying to put it to work based on a question I had earlier today (want to have formated XML displayed on my website).
Here is the code I'm trying (in a View):
XDocument xmlInput = XDocument.Parse(item.Action);
XDocument htmlOutput = new XDocument();
using (System.Xml.XmlWrit...
Hey all,
I have (or so I think!) a simple problem.
I will greatly simplify my model to speed this along.
I have a model class lets call it item:
public class Item
{
[Required(ErrorMessage="Must indicate if product is to be tracked by serial number.")]
public bool TrackedBySerial { get; set; }
}
I have an "Add" view wh...
Hi,
I'm just starting out in ASP.NET MVC (and web applications in general, as I've only really worked on console apps before), and was wondering how to display a link instead of a button for submitting a form?
Thanks.
...
I am writing an ASP.NET MVC 2 application and don't want to use ASP.NET Membership. I do want to use the Authorize attribute on the Controllers. What I have done so far is ...
Web.config
<roleManager enabled="true" />
<authentication mode="Forms">
<forms loginUrl="~/Authentication/Login" timeout="2880"/>
</authentication>
<authoriza...
Dear SO surfers,
I have a route defined as such:
routes.MapRoute(
"CustomerWithScreenName", // Route name
"Customer/{sn}/{action}", // e.g. Customer/KingKong89/Schedule
new { controller = "Customer", action = "Signup", id = "" } // Parameter defaults
);
But when I formulate a link using ActionLink like...
I've recently refactored my application with the following:
Linq to SQL db connection
Objects to wrap the linq to sql classes
Mappers to map back and forth between objects and Linq to Sql entitys
Service layer to call the repository, handing up objects to the UI.
Before I was just using Linq to SQL objects in my UI (I know). But when d...
hello Friends,
I need to display the Items in the Listbox with Checkbox for each item. using jquery or asp.net mvc?
can any body tell me how to do this kind of thing?
thanks
...
Hi,
I have to build a few ascx partial views in my MVC applications to encapsulate re-usable functionalities as well as archive SOR and SOC. However, I encountered challenge how to encapsulate the business logic that drives MVC ascx views.
In webforms, the code behind of an ASCX control can handle a button click event and browser stil...
Hello
I have an mvc-page that lists categories, and I would like to have it to count the number of products per category. It's IQueryable.
<% foreach (var item in Model.Categories) { %>
.....
<td><%: item.CategoryName %></td>
<td><%: item.Products.Count() %></td>
It lists:
5
5
Instead of:
3
2
Any Ideas how I can "partition" it per ...
How i may test ssl with mvc locally using IIS 7.5.
Because by default when if i set RequireHttpsAttribte to controller in response i am getting : The requested resource can only be accessed via SSL.
...
I want to hide a span when the validation raised
...
I need to update an element on the page based on what the user is typing, while the user is typing (i.e. without having the user to click submit buttons). Similar to how StackOverflow does the preview of the question, but I need data from the server to update the element, hence the postback requirement.
What is the best way to get this...
Hi all, in my current asp.net mvc project I'm using the built in functions for displaying resourcebased text as headers for my textboxes and stuff. In Create and Edit views this is accomplished by using the HtmlHelper LabelFor method like this:
Html.LabelFor(model => model.InternalTitle)
BUT, the default in the asp.net mvc 2 template ...
I want to create an MVC application where by I can create areas of a site that use the same functionality but work under a seperate URL. e.g.
I want to use the same image gallery controller (type not instance) under two different URLs "/Event1/Gallery" and "ProductInformation/Gallery". However if I register this in the routes table and ...
Here is what I have in my web.config:
<customErrors mode="On" defaultRedirect="/pages/sitemap">
<error statusCode="404" redirect="/pages/sitemap" />
</customErrors>
Locally this works just as expected but live for some reason I still get the vanilla 404 error page?
I am using MVC 2 with Areas, throughts?
...
I am using ELMAH to catch and log all errors from controllers.
But when errors happening i may display generic information to user using
then Shared/Error.aspx will display if any error.
But i have some exceptional case in my app and i need to display some custom error page with some information to user, for example i have such case:
...