asp.net-mvc-2

How to do Inline Editing Using JQGrid in asp.net mvc application

How to do Inline Editing Using JQGrid in asp.net mvc application..??? Thank you in advance ...

Multiproject areas in ASP.Net MVC 3

Does any one have any idea about multiproject area support in asp.net mvc 3? As it was degraded to future status in mvc 2. If it is still not included then should we look forward for ASP.Net MVC Portable Areas via MvcContrib. Can you share your expreriences? What are the recommended way for managing a large application? I read about MEF...

Folder/File browser with MVC 2 ?

How can you create a route that accept an undefined number of strings? The folder browser should be able to browse the specified folder and all the sub folders. Using JQuery to get the folders back from the server. The problem is how to build the JQuery? $.ajax({ type: "POST", url: "http://localhost:30218/Data/Fol...

How to clear Session state in MVC 2

Hello I'm working on an ASP.NET MVC 2 project and I would like to know how could I clear the Session state each time a new request is initiated by a browser. I want to use the Session state as long as the user stays on the page but once he closes it, I want to discard all Session variables, so next time when the page is requested I can ...

ASP.NET MVC2 Checkboxes in a table

I'm currently trying to create a view in asp.net MVC2 which includes a checkbox in each row. This will be a "mark" box, and there will be a button on the view which can then be used for multiple deletion. I have a model which contains a list of the objects being listed, so I have some code which reads as:- <% foreach (CancelledCard ite...

R# "cannot resolve view" when changing the default location for views + custom ViewEngine for ASP.net MVC2

We have a project in ASP.net MVC2 were we have our own ViewEngine that overrides were views locations are. Problem is that Resharper 5.1 is not picking up this, of course. Is there anyone who knows of a way to extend R# to pick this up? I don't want to disable R# to not try to resolve view globally or local with the R# comment. I want ...

How do I set multiple error messages for different scenarios in a Custom validation attribute?

I'm just getting to grips with custom validation attributes, and I'm trying to write a custom validation attirbute which will be placed at class level to validate against multiple properties of my model. I can access all properties on my model, and I want to be able to check for multiple conditions in my IsValid overload, and report on ...

Intercepting HTTP in ASP.Net MVC 2

Does anyone have any idea how I can intercept the HTML of a page and stop it getting rendered back to the client? I've tried the following, in a controller method: var writer = new StringWriter(); var response = new HttpResponse(writer); var context = new HttpContext(existingContext.Request, response) { User = existingContext.User }; ...

MVC 2 Model Validation messages

Hi, i have a view model with a property like this one : [RegularExpression(@"^d\+$", ErrorMessageResourceType = typeof(Resources.Validation), ErrorMessageResourceName = "NumberValidationMsg" )] public int? Number {get; set;} NumberValidationMsg resource is set to "Only numbers allowed !". but when I try to enter something like 'test...

ASP.NET MVC 2.0 - Difference between RenderPartial and RenderAction

I am trying to understand the difference between a RenderPartial and RenderAction. I guess that RenderPartial is like a UserControl and RenderAction is like a server-side include. Can someone put this in perspective please and if possible give me a couple scenarios of where each would be used? ...

JQGrid header height

I am using JQGrid within an ASP .NET MVC application. The grid itself is working great. However, the header height of the grid (or first grid on the page) is growing to match the height of my left navigation menu. Here is most of the Site.Master layout that I have. I just don't see why this is happening. <div class="page"> <...

How to validate a path in ASP.NET MVC 2?

I have a custom attribute that checks conditions and redirects the user to parts of the application as is necessary per business requirements. The code below is typical: public override void OnActionExecuting(ActionExecutingContext filterContext) { // ... if (condition) { RouteValueDictionary redirectTargetDictionary = new R...

Problems with unit testing in asp.net mvc ?

UPDATE: SO I am getting the error whenever I have all meta tags like HostType,AspNetDevelopmentServerHost,URLToTest. So when I comment these tags I can run the test but I need to have these tags to have the connection string available for controller to connect to database. I created a basic unit test by just right clicking on the action ...

using html.ActionLink but not html encoding

I wish to return the following output <a href="#"><img src="/images/icons/tick.png" alt="" />More info</a> If i do the following the content is html encoded. <%= Html.ActionLink("<img src='/images/icons/tick.png' />More info", "OrderRegion", "Campaign", new {id = Model.Campaign.Id}, null) %> How can i disable the html encoding? ...

Creating ASP.NET MVC style views in a console application?

I have a console application that requires me to send out e-mails. Right now I use a string builder to create the e-mails, but I'd like to get more fancy. Then it dawned on me: it would be nice to send my object to an ASP.NET MVC style view, where I'd have the HTML markup, and then return it to mail out. Right now, I have it going as; ...

Autofac - Register plugins

Hi all, i have an interface that defines some methods and i have N classes that implement it. How can i register all the classes found in all the loaded assemblies with autofac? ...

Best Practice for handling multiple authentication providers for MVC ala stackoverflow

Hi All, I'm looking for suggestions on how to handle multiple auth providers like twitter, facebook, google, openid within an MVC app. What is the general idea? I've got my own user detail table and i'm currently using ASP.Net membership authentication. When someone connects with facebook are you able to extract user detail informatio...

debugging asp.net mvc app in iis7.

When I debugging in VS development server all works ok, but on IIS7.5 in Application_Start none of my brakepoint hit. The first brakepoint which work is in default controller. This asp.net mvc2 is on .net3.5 and application pooling in iis is set to DefaultAppPool in integration mode. Where to looking for solution? ...

How does ASP.NET MVC 2 handle different request formats (i.e. HTML, XML, JSON, JS, etc.)

Hello. I'm diving into ASP.NET MVC 2 and I'm trying to understand how it handles different request formats. In Ruby on Rails, you specify in the controller which response format to return based on the request... respond_to do |format| format.html #action.html.erb format.xml { render :xml => @employees.to_xml(:root => "employees") ...

MVC2 Cookieless Session Issue using POST

For some reason with cookieless session enabled in MVC2, the session id in the query string is reset with every form post that happens. Is there a special route that needs to be setup for this to work? Are there any other gotcha's I need to be aware of? Thanks. ...