asp.net-mvc-2

Asp.Net mvc 2 , DropDownListFor and Editor Template . Selected Value dosen't work

I Have 2 views. ProductForm.aspx and Category.ascx. CategoryForm is a Partial View. I Call the Category.ascx from the ProductForm with EditorFor(model => model.Category) . In this partial view, there is a DropdownlistFor with all the category. The problem is the Selected Value for a specific Product Category. The selected value dosen't w...

ASP.NET MVC2 - is it possible to access parent view's model data from partial view?

In handling a 1--->0...1 relationship, I'm trying to use a separate partial view for the 0...1 end. I'd like to use RenderPartial() rather than RenderAction(), for the sake of efficiency. Is it possible to gain access to the containing view's model data from this partial view, in order to access the PK/ID of the main object? Is this j...

Help with mapping ActionLinks to Methods in Controllers (ASP.NET MVC2)

I'm on my first MVC project and still haven't got a complete hang of it. I ran into this issue: I have this in my View (Home/Index.aspx) <% using (Html.BeginForm()) { %> <fieldset> <p> <%: Html.TextBox("A")%> <%: Html.TextBox("B") %> <%: Html.ActionLink("Submit", "Create", "Home")%> </p> </fieldset> <% } %> I have this...

What does this error mean? The remote host closed the connection. The error code is 0x80070057.

Hi Even though a couple people have asked this question it seems there problem is different than mine. Like most of them seem to get line numbers or the problem might be caused with ViewState. I am using Asp.net 4.0 MVC 2.0 so I don't think I am using ViewState at all. My error does not give me line numbers are well. So I have no clue ...

Validation / Error Messages in ASP.Net MVC 2 View Unrelated to a Property

What pattern can I use to display errors on an MVC 2 view that are not related to a single property? For example, when I call a web service to process form data, the web service may return an error or throw an exception. I would like to display a user-friendly version of that error, but have no logical means to relate the error to any ...

Unable to create strongly typed view in VS2010 with Fluent Nhibinate and MVC2

HI, I was wondering if any one else had had a problem with VS2010 MVC 2 projects not being able to automaticly create a strongly typed view after doing a fluent mapping? When trying to do the mapping VS2010 doesnt show the Entities in the drop down and even if i manually put the class in it doent auto build the view . Cheers Dan ...

jQuery POST to ASP.NET MVC2 action, string is binding, integers aren't binding...???

Here is the JS: $('#createReview').click(function () { CKEDITOR.instances['ReviewText'].updateElement(); $.ajax({ type: 'POST', cache: false, url: '/Review/Create', data: $('#reviewForm').serialize(), dataType: 'html', success: function (response) { $('#bookReview').htm...

I have an existing asp.net mvc site (on iis 7), can I add wordpress on a /blog subdirectory?

I have an existing site that is using asp.net mvc 2.0 and I want to add wordpress in a /blog subdirectory. Is this possible? How would I go around to doing this? The site has a wildcard SSL certificate, not sure if that has any effect on the binding for the subdirectory? Also, are there any security issues I should be worried about (...

How would I do Subsequent sort on a child table in asp.net mvc2 using Entity Framework

I am trying to do something like this: ViewData.Model = _db.Questions .Include("QType") .Include("QTags") .Include("SubQuestions.Options") .Where(q => q.Active == true) .Orderby(q => Questions.Order) ...

StackOverflowException with Spark View Engine

Whenever I call Html.RenderAction from a Spark view I get a StackOverflowException. If the action returns ContentResult, everything works fine but when I change to ActionResult I bump into the exception. I work with ASP.NET MVC 2 and latest Spark release (1.1.0.0) Any ideas? ...

How MVC fill Id parameter?

Hello, today I've got some interesting observation, that I need to explain. I've got my Person class that is described as above: public class Person { public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } } now in my MVC2 application I've got PersonController with following ed...

Dropdownlist in ASP.NET MVC2

Hello, In my model, I have this : public class CustomerModel { public Customer Customer { get; set; } public Language Language { get; set; } public IList<Language> Languages { get; set; } public CustomerModel() { Language = new Language(); } } In my view, I have t...

MVC 2 map routing from one controller to another

Hi, I am using MVC 2. I have 2 controllers called Application and Note. The application is a loan application. A note can be added to an application. On my Index I have a grid that displays all the applications, and an action column with a link that says "Add Note". In my Application controller I have action methods for create and ...

ASP.NET MVC Generic templating and collections

Is is possible to apply an attribute to a collection, and then detect this when iterating through the collection members using ViewData.ModelMetadata.Properties ? I would like to apply an attribute to the collection to specify whether items in the collection should be displayed in their entirety or not. I want to then detect this in th...

How to place logic for several different roles in ASP.net MVC 2

Hello fellow developers, I am a bit new to ASP.NET MVC and I have a bit of an ordeal. I am developing a website with several roles in it and of course the logic and gui that the user gets depends on the role (duh). There are 10 separate roles in this application. They do share most of the same functionality but some screens will be di...

Html.Hidden builds wrong value data in MVC 2 app

I am using an id value that I pass in a hidden field. When the user submits the form I need the hidden field for my update. After the update, a new value is placed in the hidden field in the model and sent back to the view. What seems so strange is the helper always uses the first value, never updates. For example, look at the following ...

How to make a setup installer? For asp.net mvc 2.0, cmd line applications and webservices.

Hi I am wondering how can I make a setup project for each of these projects Asp.net mvc 2.0 C# cmd line Application C# web-service I am using VS 2010 ultimate and I know that I can use the the free edition of install shield for at least the cmd line application. I am not sure about the other 2. I also know about the setup project ...

How to correctly canonicalize a URL in an ASP.NET MVC application?

I'm trying to find a good general purpose way to canonicalize urls in an ASP.NET MVC 2 application. Here's what I've come up with so far: // Using an authorization filter because it is executed earlier than other filters public class CanonicalizeAttribute : AuthorizeAttribute { public bool ForceLowerCase { get;set; } public Can...

Upload image with Jquery form plugin not working in IE8

I am using jQuery form plugin in my MVC project for image uploading. The image upload works perfect in Chrome and firefox, however when it comes to IE 8. Not like Chrome, instead of returning json data which is later consumed by post-submit callback, in IE 8 it returns a txt file and ask you whether you want to download. and in side th...

How enable or disable Entity validation.

I use Entity Framework 4 and MVC 2. I Have an Address Entity, Contact, Company. There are a relation between Contact and Address and Company and Address.. A Contact can Have an Address and a Company can also have an address too. I created a Partial View for Address. <div class="editor"> <%: Html.HiddenFor(model => model.Ad...