asp.net-mvc-2

MVC2/Jquery validation issues.

I have read the following: http://weblogs.asp.net/imranbaloch/archive/2010/08/23/asp-net-mvc-jquery-validation-and-validationsummary.aspx http://haacked.com/archive/2009/11/19/aspnetmvc2-custom-validation.aspx And still can't get the jQuery validation to work with MVC2. I can get non jQuery working but when i swap out the JS files it ...

MVC 2.0 - different view based on URL with shared controls

I have 2 master pages. One is intended to be shown in a normal standalone website. The other is to be used in external sites as an Iframe. I want to be able to show the normal page at http://example.com/home/index and the iframed version at http://example.com/framed/home/index I want to have controls that will postback to one control...

ASP.NET MVC Inline Edit

I am building an MVC 2 web app, where I want to display information about something (the parent) as well as child details which are displayed as rows (children have a many to one relationship to the parent). I have implemented AJAX in MVC before using Ajax.BeginForm and partial views Using this method - with minor changes for MVC 2 rel...

Easiest way to alter required validation message site wide

I would like to replace validation message for all model properties that have [Required] attribute from the default "The XY field is required." to "*". I want to do that site wide in one place without having to add a custom message to Required attributes or passing additional parameter to ValidationMessageFor() Html helper. Any ideas? ...

using slick upload with mvc 2 and jquery / ajax

Hello Everyone! i'm trying to get slick upload working inside a jquery ui dialog. I've got it uploading the file just fine, and i've checked out the samples, and they all end up with the entire page re-loading. i've managed to make it so it doesn't do it's final postback to deal with the files after it uploads by setting the AutoPost...

Edit in a new page with jqGrid

Hello, I would like to edit the rows of my jqGrid in a new page. I have setup a custom function for the edit button with the use of the parameter "editfunc". How can I redirect the user to that page within the javascript function? I am using asp.net MVC 2. ...

asp.net mvc azure "Error accessing the data store!"

I've started using the AspProviders code to store my session data in my table storage. I'm sporadically getting the following error: Description: Exception of type 'System.Web.HttpException' was thrown. INNER_EXCEPTION:Error accessing the data store! INNER_EXCEPTION:An error occurred while processing this request. INNER_EXCEPTION: C...

datetime problem after deployment of asp.net mvc application

Hi, I have developed the asp.net mvc 2 + C# application. it has create functionality in which there is datetime field. If locally I runs the a application it is working fine . but if i deploys it on IIS server (v 5.1) it, is not accepting date more than 12 (if gives 14/10/2010) will not work), this means it is changing the date format a...

Pass "DirectoryInfo" object into Controller from a View?

I'm new to MVC2 and was wondering if it was possible to pass an object into a Controller Action from a View? e.g. I've created a ViewModel containing a list of DirectoryInfo objects and pass this to my Index view. In the view, I loop through all of the DI objects and for each one create an ActionLink. <%:Html.ActionLink(linkText: subf...

Dropping Json object on html page in asp.net mvc2

Hi, i m using asp.net mvc2 and i want to drop some json objects from my controller similar to validation metadata. when we call Html.ClientValidation() before our form it drops some javascript on the page like <javascript type="text/javascript"> <!--CDATA[validation metadata]--> </javascript> i want to have some json objects dropp...

How to Use compare validator

Please tell me how to apply compare validater for password and confirm password in ASP.NET MVC2. Please give me some good link or any sample. Thanks ...

MVC2 Html.ValidationMessageFor: add htmlAttributes but keep the default message

Hi. I would like to change the htmlAttributes of the code rendered by my Html.ValidationMessageFor, but I want the message displayed to be the "default". The overload options are: A) Html.ValidationMessageFor(expression) B) Html.ValidationMessageFor(expression, validationMessage) C) Html.ValidationMessageFor(expression, validationMessag...

MVC 2.0, StructureMap, Areas, and Duplicate Controller Names

I have a bit of a problem. I have an area called Framed. This area has a home controller. The default for the site also has a home controller. What I'm trying to do with this is have a version of each controller/action that is suitable for an IFrame, and a version that is the normal site. I do this through Master pages, and the si...

Are MVC2 display templates considered good practice?

I'm learning the ASP MVC2 framework, with no prior knowledge of MVC1. At the moment I'm constructing a toy website for learning purposes. So far I've been primarily using Html.RenderPartial as my main means of organizing view rendering. In theory I'd prefer something less imperative and more declarative. I've read several tutorials on ...

ASP.Net MVC 2 partialview that reads part of URL

Hi all, i am creating a partialview with a controller action like: public ActionResult GetPostsByUser(string userName) { where userName is part of the URL: www.example.com/User/toddM toddM being the userName First off.. am i going about this the right way?? if i make it a querystring ?userName=toddM it works.. but i need it ...

Design questions re: EF4 and ASP.NET MVC 2

I have a couple of questions about good design with EF4 in an ASP.NET MVC 2 project. First, validation. Should I place my form validation within my entities' SavingChanges events? How would I obtain the form data within the partial class? Or is there a better way to do it? Second, maintaining logged in users. I come from a PHP back...

ASP.NET MVC 2 Ajax form submit, error: returns error with no information?

Hi All, i have a partial view with a form in it. It is strongly typed. I am using ajax in a view with the partial view in it to submit the form. It's basically a form that creates a new DB item and i can see that the controller action is working and being called. my ajax submit looks like this: $(document).ready(function () { v...

Custom IIdentity and IPrincipal using FormsAuthenticationTicket cookie in MVC2

I am currently trying to implement some custom security in an ASP.NET MVC2 web application. I am trying to do something really simple as my code below shows but for some reason if I use the [Authorize(Roles="Admins")] attribute on one of my controller actions, check the Context.User.IsInRole("Admins") or Page.User.IsInRole("Admins") it ...

Enabling html PUT method on IIS 7.5

I'm doing a iCal Service to allow sync between Calendar instances and runs fantastic on localhost (under VS2010 Web Server) But now That I hosted on a Windows 2008 R2 (IIS 7.5.7600) I couldn't create not even update an event :-o Thunderbird always said So I rush into Fiddler and found out the problem a 405 error That says PUT ...

call other method before action call using asp.net mvc 2

I want to call other method or other technique before action call in asp.net mvc 2. Because I want to set property in variable then to call action in controller. can any one guide me if possible. ...