I saw that __VIEWSTATE field gets rendered even though I have set the EnableViewState="false" at the page level. This field is not rendered if I remove runat="server" tag for the form element. Can somebody please explain this?
...
Hi folks,
how do i do the following, with an ASP.NET MVC UpdateModel? I'm trying to read in a space delimeted textbox data (exactly like the TAGS textbox in a new StackOverflow question, such as this) into the model.
eg.
<input type="Tags" type="text" id="Tags" name="Tags"/>
...
public class Question
{
public string Title { get;...
Hi Folks,
do I have to register the HttpVerb constraint in my route definition (when i'm registering routes) if i have decorated my action method with the [AcceptVerbs(..)] attribute already?
eg. i have this.
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(FormCollection formCollection)
{ .. }
do i need to add this to the r...
Hi,
I have been banging my head against a brick wall trying to deploy my MVC app on IIS6 (linked question)
I have scrapped wildcard mapping for the time being and am trying to get the .mvc extension working. Everything is configured correctly in IIS and the .mvc extension is pointing to the .NET dll for all verb types (unchecked verify...
Into some view data i have put the result of an anonymous type:
var projectData = from p in db.Projects
orderby p.title
select new
{
Title = p.title,
DevURL = p.devURL ?? "N/A",
...
I'm looking for good patterns for implementing a paged table of results in ASP.NET MVC with sorting, filtering, and paging provided via AJAX. It seems to me that I should have my controller actions provide only the data and not mark up to maintain the separation of concerns -- so the Ajax callback would provide new table data and pager ...
How can I test Controller.ViewData.ModelState? I would prefer to do it without any mock framework.
...
I have developed a simple mechanism for my mvc website to pull in html via jquery which then populates a specified div. All is well and it looks cool.
My problem is that i'm now creating html markup inside of my controller (Which is very easy to do in VB.net btw) I'd rather not mix up the sepparation of concerns.
Is it possible to use ...
What are the new features you would like to avail in ASP.NET MVC in the future releases?
I Would say
1) A separate view engine for ASP.NET MVC instead of current WebForm view engine.
2) Asynchronous Controller Actions.
3) Subcontrollers / Partial Requests.
...
Hi,
In preview 5 I was overriding the OnActionExecuting in my custom controller class, but now for some reason in beta it is giving me an error saying the parameter FilterExecutingContext doesn't exist?
protected override void OnActionExecuting(System.Web.Mvc.FilterExecutingContext filterContext)
What is the parameter now?
...
I would try something like this but it isn't allowed.
function GetDynamicModulesProperties() {
var selectedValue = $("#moduletype option:selected").val();
if (selectedValue.lenght() > 0) {
var url = '<%= Url.Action("GetModuleProperties", new { sectionid = ViewData.Model.Id, moduleTypeId = selectedValue } ) %>';
...
I hope my terminology is right. Edit if not.
From my Linq2Sql classes I have a Color class.
One of my controller's actions accepts an instance of this Color class.
I want to create a link to this action so I use
<%=Html.ActionLink<ColorController>(c=>c.Details(ViewData.Model.ActiveColor), "test")%>
Where ViewData.Model.ActiveColor ...
I have an MVC Controller that runs through a process, sets some View Data, and then returns the results of this data back to the user in a View. The process time is dependent on the amount of data that is being processed. I need a good way to display an animated .gif within the View while the process is running, letting the user know t...
I have the following code, I'm trying to get a table with 4 columns across. If I run out of columns, create a new row and make 4 more coumns. rinse. lather. repeat.
<tbody>
<%
int i = 0;
foreach (ItmXtnMultimedia multimedia in ViewData.Model.ItmXtnMultimedia) {
if (i%4 == 0 && i== 0)
{
%><tr><%
}
if (i%4 == 0 && i != 0)
{
...
I have a rather simple scenario where I have two tables in which I want to add data. They are managed with primary key/foreign key. I want to add new data into TABLE A and then retrieve the Id and insert into TABLE B.
I can certainly do it with a stored procedure, but I'm looking at trying to do it using Linq.
What is the best approa...
How do I create tabbed navigation with the "Current" tab highlighted in the UI?
...
I encountered the above error message after applying the OutputCache attribute on ActionResult methods with no input parameters - why would I use VaryByParams in this case? Is this a bug in ASP.Net MVC or is there a way of using OutputCache without setting this property?
My big question is, if I have to use VaryByParams, what should I e...
Hi,
In asp.net mvc, I want to create a action for login.
So this is how I am doing it:
create a action/view named login that simply displays the view.
create another action, named login2 that will be the page that handles the form post and checks the database if the username/password are correct. If it is, redirect to somepage, if n...
anyone have have a dropdownlist helper method with a list of US states? thanks.
...
Given the following class, what is your opinion on the best way to handle create/edit where Attributes.Count can be any number.
public class Product {
public int Id {get;set;}
public string Name {get;set;}
public IList<Attribute> Attributes {get;set;}
}
public class Attribute {
public string Name {get;set;}
public string Val...