i have the following foreach. Inside you'll see a text box for quantity. At the bottom of the page there is submit button. What is the best practise for saving a collection of fields like this in asp.net MVC. ie how would i get the values in my controller
<% foreach(var item in Model.Results) { %>
<tr class="RowStyle">
...
Let us say I have a url of subdomain.domain.com. Is there a way in ASP.NET MVC to have a url of say otherdomain.com/gotothesubdomain that takes you to subdomain.domain.com? I know that a simple redirect could do it, but I want the url to stay as otherdomain.com/gotothesubdomain.
Any advice would be greatly appreciated and thanks!
...
So we're having some issues deploying an ASP.NET MVC app to a client site. Basically when we try to test the app from localhost, we get the dreaded Global.asax parser error indicating it could not load the application global.
Research indicates there are basically 4 possible reasons for this exception we're seeing:
The solution hasn'...
I've tried asking this in a few different ways, but let's give it another shot (as I've yet to receive an answer and this is driving me nuts!)
I have a very large classic ASP 3.0 application (~350K lines) that I want to start migrating to ASP.NET MVC. I'd like to keep the old ASP files in a separate project from the MVC stuff.
Ideas o...
I've read from a few individuals (Simone Chiaretta, Sebastien Lambla) that "you should remove the AccountController" from your ASP.NET MVC apps, but without much reason. I'm currently using it in one intranet site and am working on a second that will be considerably more widely used. What is wrong/bad about the default code that makes ...
I have a webpage with two radiobuttons and a dropdownlist as follows:
<div class="sectionheader">Course
<div class="dropdown"><%=Html.DropDownList("CourseSelection", Model.CourseList, new { @class = "dropdown" })%> </div>
<div class="radiobuttons"><label><%=Html.RadioButton("CourseType", "Advanced", false )%> Advanced <...
Hello, I'm working on a project that requires the ability to let a user download a pdf from a static location on the server. I'm reading the instructions from this website, it's an old post and I notice they specify in an update that Microsoft's MVC framework has long since included and Action Result that allows the same functionality t...
Total noob question here, but not finding the answer via search.
What is the method equivalant of <%= expression %>?
I'm looking to replace this:
<%
foreach (var intem in IE) {
%>
<%= Ajax.ActionLink(item,...) %>
<% } %>
with:
<%
foreach (var intem in IE) {
SomeOutputCall(Ajax.ActionLink(item,...));
}
%>
...
I used the code below so far with ASP.NET MVC v1 and v2 but when I added an Area today to my application, the controller for the area couldn't find any views in my Areas/Views/controllerView folder. It issued the very well known exception that it searched those 4 standard folders but it did not look under Areas..
How can I change the co...
I have a MVC project that has a Linq to SQL dbml class. It is a table called Clients that houses client information. I can easily get the information to display in a View using the code I followed in Nerd Dinner but I have added a stored procedure to the dbml and it's result set is of IQueryable, not IQueryable. I need to convert IQue...
Basically, what the title says. I have several properties that combine together to really make one logical answer, and i would like to run a server-side validation code (that i write) which take these multiple fields into account and hook up to only one validation output/error message that users see on the webpage.
I looked at scott gut...
I can get the current action name by using the following code
var currentActionName = ControllerContext.RouteData.GetRequiredString("action");
but is it possible to get the previous action name as well?
...
Hi all, I have a column in my Model with a NULLABLE boolean value. Now on my View (for editing), I would like to bind that to two radiobuttons: Yes & No. If the value is null, then just have the two radiobutton un-checked. How would I go to do that?
Thanks.
...
Hi All,
Is it possible to post, say like a value in a textbox, to 2 different ajax forms that are on the same page? It doesn't have to be at the same time?
What I'm trying to do is this: I have a search page that searches for customers and displays them on a paged grid. Users can specify up to 5 parameters (5 textboxes) to narrow the s...
Hello ...
I´m new to ORMs and I have a new project I´ll do in .Net MVC.
In the Model Layer I´ll create my classes: Videos and I´ll work with APIs as a DataLayer (BrightCove & YouTube APIs).
So, I dont have a Relational Database as a Data Layer. Is it possible to work with an ORM (as Subsonic)?
Thanks!
...
The Route is:
routes.MapRoute(
"Ajax", // Route name
"BizTalk/Services/{action}", // URL with parameters
new
{ // Parameter defaults
controller = "BizTalk"
}
);
My Controller is:
public JsonResult AjaxTest(string s, int i, bool b)
{
return Json("S: " + s + "," + "I: " + i + "," + "B: " + b);
}
My ...
Hi, I am trying to learn Domain Driven Design and recently read that lots of people advocate creating a ViewModels for your views that store all the values you want to display in a given view.
My question is how should I do the form validation? should I create separate validation classes for each view, or group them together? I'm also c...
Hi all,
I have done some refactoring on a asp.net mvc application already deployed to a live web site. Among the refactoring was moving functionality to a new controller, causing some urls to change. Shortly after the various search engine robots start hammering the old urls.
What is the right way to handle this in general?
Ignore it...
I've got problem with binding data type boolean to checkbox in MVC 2 data annotations
Here's my code sample:
label>
Is Hot
</label>
<%=Html.CheckBoxFor(model => model.isHot, new {@class="input" })%>
It always raise this error message below at (model=>model.isHot).
Cannot convert lambda expression to delegate type 'System.Func<Framew...
I like MvcContrib Grid's AutoGenerateColumns feature, however it only seems to work with simple objects. Is it possible to get it to traverse the properties of a complex object? Or is it neccesary to do this manually with column.For()?
An example would be a User object that has an Address object as one of its properties.
...