asp.net-mvc-2

ASP.NET MVC2 Radio Button generates duplicate HTML id-s

Hi, It seems that the default ASP.NET MVC2 Html helper generates duplicate HTML IDs when using code like this (EditorTemplates/UserType.ascx): <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<UserType>" %> <%: Html.RadioButton("", UserType.Primary, Model == UserType.Primary) %> <%: Html.RadioButton("", UserType.Stand...

manage date fields when are int in the db

Hi in my db there is a field "date_start" type integer. This is the part of form for this field <div class="editor-label"> <%: Html.LabelFor(model => model.date_start) %> </div> <div class="editor-field"> <%: Html.TextBoxFor(model => model.date_start, new { @class = "calendar" })%...

extending an entity framework model

Hi, i want extend an entity framework model with a temporany attribute. I need it only in a mvc form. I don't need save it in the db. How can i do it? ...

Problem with updating data in asp .NET MVC 2 application

Hello everyone, i am just getting started with asp .NET MVC 2 applications and i stumbled upon a problem. I'm having trouble updating my tables. The debugger doesn't report any error, it just doesn't do anything... I hope some can help me out. Thank you for your time. This is my controller code... public ActionResult Edit(int id) {...

How to read the values returned by the Json?

I have the following code in my view: <% using (Ajax.BeginForm("JsonCreate", new AjaxOptions { OnComplete = "createCategoryComplete" })) { %><div id="createCategory"> <fieldset> <legend>Add new category</legend> <p> <%=Html.TextBox("CategoryId")%> <%=Html.TextBox("Test")%> <label for="na...

When is ReleaseController method called?

I'm implementing a custom ASP.NET MVC controller factory. I wonder when the ReleaseController method is called? Is it the same time as EndRequest? ...

Using view in several pages

Hi, everybody! I have a view (let's say x) that I want to use at some parts of several pages (let's say y, z, t). The action (let's say a) that called from view (x) calls a web service that returns me an id (let's say i) and returns the same view (x) again. And in the pages (y, z and t) I want to do different things using this id (i). H...

Use html files from another project in ASP.NET MVC

I know that I can use normal html files in ASP.NET MVC; however I have a situation where several (above 20) html files are needed for static display. This is fine and good, but I really don't want it cluttering the MVC project since none of them will have controller actions. Is there any way to load up a second project and use static h...

Storing mvc2 entity model in cache

I getting data from a webservice. (one-time timelimited password used for login) Data only needs to be read, no updates. I'm still looking for the best framework to put this in without making the small-medium site too heavy. If I only gets my data from the webservice once, puts this in several objects.. Would it make sense to store thi...

RenderPartial cannot be converted to a string

I'm working with Telerik's MVC Tabstrip control and am having an issue, although I suspect the issue is more my ignorance of how to properly use Lambda expressions and MVC helpers and not really Telerik-specific. My helper call is this: <% Html.Telerik().TabStrip() .Name("BusinessDetailsTabs") .Items(parent => {...

How do I use Unity to inject dependancies into ValidationFilters?

I know how to inject dependencies into Action Filters, but I cannot figure out how to do the same with Validation Filters. Is there the equivalent of an ActionInvoker I can tap into? ...

Collection of MVC CSS files available?

Just curious - are there various customized Site.css files (and accompanying images) that work with the default ASP.NET MVC 2 templates? I'm a stereotypical developer who "doesn't do pretty" so I'd like to find a design that is good enough for me to use until I later have a designer come back and fix my design. Are there collections/lib...

Donut Caching ASP.NET MVC2

Is there a possibility to do Donut Caching with MVC2? Even with a lot of research I was not able to find a working solution. ...

Best Practice, objects design ASP.NET MVC

Hello Stackoverflow I have a code design question that have been torbeling me for a while, you see I’m doing a refactoring of my website Cosplay Denmark, a site where cospalyers can upload images of them self in their costumes. The original site was done in php, Zend MVC, but my refactoring is being done in ASP.NET MVC 2. If you take t...

i need help with using string template with .net mvc2, where do i get started?

Hi, I'm trying to try out string template with .net mvc, but i can't find any tutorial that is good for newbies and give me a step for step guidance through how to implement string template with c# and .net mvc2... any help is really very very very very ........ very appreciated Lina ...

Adding childs to list of parents with jquery /mvc2

Hi, I have a table of products on my page, each product has zero or more colors, the colors are shown as a list beneath the product. After the colors I have a button to add a color. The button will do an ajax call with the parent product id to a controller which will return a JSON object with color information. My problem is where to st...

ASP.NET MVC2 custom rolemanager (webconfig problem)

Structure of the web: SAMembershipProvider.cs namespace User.Membership { public class SAMembershipProvider : MembershipProvider { #region - Properties - private int NewPasswordLength { get; set; } private string ConnectionString { get; set; } //private MachineKeySection MachineKey { get; set...

Custom authentication doesn't work with asp.net 2.0

Hello I'm trying to upgrade my mvc 1.0 application that had a custom written login. I assign the authcookie like this: string _roles = string.Join(",", _ugr.GetUsergroupRoles(_username)); FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket( 1, _username, DateTime.Now, DateTime.Now.AddHours(1)...

ASP.NET MVC2 Implementing Custom RoleManager problem

To create a custom membership provider I followed these instructions: http://stackoverflow.com/questions/2771094/asp-net-mvc2-custom-membership and these: http://mattwrock.com/post/2009/10/14/Implementing-custom-Membership-Provider-and-Role-Provider-for-Authinticating-ASPNET-MVC-Applications.aspx So far, I've managed to implement custo...

custom MVC2 editortemplates

i would like to create a library of custom EditorTemplates and DisplayTemplates. How do I "load" these into my MVC application? I want to be able to re-use my custom template library across a variety of MVC apps. ...