asp.net-mvc-2

Blowery HttpCompress with ASP.NET MVC

I'm using the httpcompression module from blowery. It works great with asp.net mvc except on the root url, www.samplesite.com/. On all others it's great, www.samplesite.com/Countries for example. Is anyone here using this module or any other compression module with asp.net mvc ? ...

Will there be any problem if i inherit aspx page from System.Web.Mvc.ViewPage

I am developing a website which will be having both asp.net pages and MVC pages in it, So I have BaseWebPage class which will be used for both asp.net pages and MVC Views. but My BaseWebPage class is inherited from System.Web.Mvc.ViewPage, So Will there be any code/ functionality break for normal asp.net pages, because System.Web.Mvc.Vie...

MVC2 Validation

My application uses MVC validation explained here: http://blog.stevensanderson.com/2010/01/28/validating-a-variable-length-list-aspnet-mvc-2-style/ And it works fine with both server and client validation when the form is posted. However my problem is that I would like to have client validation on one of the fields before the form is po...

Visual Studio 2010 Full and ASP.NET MVC 2.0 Template

Hello, I've installed full version (not RC nor Beta) of Visual Studio 2010, a then setup within Web Platform Installer 2.0 announce me that I need to install MVC 2.0, so i did it. When I want to create project "MvcWebApplicationProjectTemplate" in VS I have following message: error: this template attempted to load component assembly '...

Ideas in implenting the following entry form in ASP.NET MVC 2

Hi guys, I have a very simple data entry form to implement. It looks like this: Obviously I have mocked out the actual requirements but the essence is similar. Entering a name and clicking history should bring up a pop up pointing to the url '/student/viewhistory/{name}' Name and age are required fields The sub form (in the mockup...

How can I create generic class from System.Web.Mvc.ViewPage

How can I create generic class from System.Web.Mvc.ViewPage ...

ASP.NET MVC2 - specific fields in form pass via a specific object?

In database I have Contacts table: ContactID (int) FirstName (varchar) LastName (varchar) ... XmlFields (xml) // This field is xml type To create a new contact, I created two classes - one for regular fields and other to display fields from XmlFields field. In Controller, I have following: public ActionResult Create(Contact contact,...

Can I Implement Caching in MVC, If so how?

Can I Implement Caching in MVC, If so how? I wanted to implement Cache in Controllers ...

ASP.NET MVC 2 - Is it worth creating a custom model binder for this scenario?

Well i have a complex form view model like this : public class TransactionFormViewModel { public Session SessionRecord { get; private set; } public IEnumerable<Resource> ResourcePerSessionRecord { get; private set; } public Person PersonRecord { get; private set; } public decimal SubTotal { get; private set; } publi...

Getting an entity from a repository by a custom string

What is considered good practice for querying entites from a database using a simple string as a query parameters. Who should implement the method that "converts" the string to an Entity, and who should call this method? The repository, the entity, or some other object, like the controller in an MVC application? For a more concrete exam...

ASP.NET MVC2 - Render a View as a String

How do you render a view as a string from a controller in MVC 2? In MVC 1, I used CaptureActionHtml. I'm having the same problem with it as a similar question, but is there a way to do this without Rhink.Mocks? ...

MVC2 Json request not actually hitting the controller

I have a JSON request, but it seems that it is not hitting the controller. Here's the jQuery code: $("#ddlAdminLogsSelectLog").change(function() { globalLogSelection = $("#ddlAdminLogsSelectLog").val(); alert(globalLogSelection); $.getJSON("/Administrative/AdminLogsChangeLogSelection", { NewSelection: globalLog...

Under what circumstances would a LINQ-to-SQL Entity "lose" a changed field?

I'm going nuts over what should be a very simple situation. In an ASP.NET MVC 2 app (not that I think this matters), I have an edit action which takes a very small entity and makes a few changes. The key portion (outside of error handling/security) looks like this: Todo t = Repository.GetTodoByID(todoID); UpdateModel(t); Repository.Sav...

Renderpartial or renderaction

have an action that generates active vacancies. The code is below; public ViewResult OpenVacancies() { var openvacancies = db.GetActiveVacancies(); return View(openvacancies); } I want to use this list on several pages so i guess the best thing to use is html.renderaction (please correct me if i ...

JQuery idleTimeout plugin: How to display the dialog after the session is timedout on ASP.NET MVC Page

Hi I am working on migrating the ASP.NET apllication to MVC Framework. I have implemented session timeout for InActiveUser using JQuery idleTimeout plugin. I have set idletime for 30 min as below in my Master Page. So that After the user session is timedout of 30 Min, an Auto Logout dialog shows for couple of seconds and says that "You...

ASP.NET MVC2 Data Access Layer

For a small/medium sized project I'm trying to figure out what is the 'ideal' way to have a domain layer and data access layer. My opinions on coupling tend to be more towards the view that the domain models should not be tightly coupled with the database layer, in other words the data access layer shouldn't actually know anything about ...

Showing an image after loading it from sql database

I have a problem showing the image form database in a view Details and a ImageController. Inside the view I have: img src=Url.Action("GetFile","Image", new {id= Model.id}) and in controller: public FileContentResult GetFile(int idl) { //int idl = 32; SqlDataReader rdr; byte[] fileContent = null; ........... return Fil...

ASP.Net MVC2 DropDownListFor

Hi all I am trying to learn MVC2, C# and Linq to Entities all in one project (yes, I am mad) and I am experiencing some problems with DropDownListFor and passing the SelectList to it. This is the code in my controller: public ActionResult Create() { var Methods = te.Methods.Select(a => a); List<SelectListI...

I can't get areas working in VS2010

I just upgraded from VS2010 RC to RTM. Now my areas aren't working. I have a Profile area with a Home controller and an Action method Index(). If I try: http://localhost:4951/profile I get a 404 error saying that the resource can't be found. If I try http://localhost:4951/profile/home I get the same error. However, if I try http:/...

MVC controller is being called twice

Hello, I have a controller that is being called twice from an ActionLink call. My home page has a link, that when clicked calls the Index method on the Play controller. An id of 100 is passed into the method. I think this is what is causing the issue. More on this below. Here are some code snippets: Home page: <%= Html.ActionLink(“...