asp.net-mvc

mvc controller returns 'html data' instead of view

i have a module controller which returns(renders) a view page (.aspx) into the main.aspx page but now i want the controller to return the entire content of .aspx page to the javascript function from where this controller has been called pls help my calling function in main.aspx $.get('/Module/Select/', { TemplateName: Te...

Display list of values in MVC Detail View

I am new to web apps, MVC, and LinqToSql. I created an MVC web app using the NerdDinner tutorial as a guide. I'm now adding many-to-many relationships to it. And am just running into walls at every step. I have a multiselect list in the Edit and Create views. For the Detail and List views I would like to list the selected values. ...

How to use sql server 2005 stored procedures in asp.net mvc?

I have just started a new web application with asp.net mvc and sql server 2005... Thus far in my webform applications i used ADO.NET... I want the same in my asp.net MVC apllication... I have a database in sql server 2005 with all the stored procedures... Now i want to use those stored procedures in my MVC application... I dont use any...

ASP.Net MVC FilePathResult Failing in IE

I have a controller action that returns a pdf document. Depending on a site switch variable it will choose one of a number of source files, rename it and return it to the browser. This works perfectly on Chrome and Firefox but, on IE8, the download dialog appears and then the following error messagebox... "Internet Explorer cannot do...

How to get started with Linq to sql?

I am developing a new web application which would be simple and i decided to use asp.net mvc and Linq to sql.. I thus far have no idea about Linq to Sql... How to get started with Linq to sql? What should i watch out for when using Linq to sql? ...

Adding rel and title to ASP.NET MVC Action Links

I decided primarily for SEO reasons to add the "rel" to my action link, but am not sure that the way I have gone about this is going to follow "best practices." I simply created a new Extension method as shown below. Is this the best way to go about doing this? Are there things that should be modified in this approach? VIEW <%= H...

validations on html.dropdownlist in MVC?

Hello All, How shall I perform validations on the Html.Dropdownlist in my mvc application,Please tell what shall I do. Thanks Ritz ...

KeyNotFound Exception when calling Html.ValidationSummary() dynamically through helper method

Hi, I have a Helper Method in my View which renders the whole form dynamically. Now i want to add a support for Client Validation as available in Asp.Net MVC RC 2. Following is the code i use to render Validation Summary field onto the Form. _viewPage.Html.EnableClientValidation(); MvcHtmlString validationSummary = _viewPage.H...

Textbox validation in MVC2

I have added Required attribute to one of my properties of Model class as follows - [Required(ErrorMessage="UserID should not be blank")] [DisplayName("User Name")] public string UserName { get; set; } Inside my view, which inherits the class containing above property, I have tried to apply validaton to a textbox as follows - <%= Ht...

Where can i find list of good HTML Helpers to use with asp.net MVC?

As i am new to asp.net MVC and HTML Helpers.. I really want to know Where can i find list of good HTML Helpers to use with asp.net MVC? Additional Info: I would really love to get the list of HTML Helpers used by StackOverflow... If anyone knows can share... ...

How could I use ASP.NET MVC framework in conjunction with my CMS software?

I have been reading on MVC and I created some db-driven pet projects with it and I am very pleased with the shift from WebForms. However, I have a bit of a limitation that holds me back with WebForms and I was wondering if you could help me with it. I work for a Web CMS company as a Consultant, therefore all websites (public sites, int...

Base Contoller Get Value

I having trouble getting a value to my base controller. All I would like to do is have my base contoller pick up a ID from an ActionLink? Link <%= Html.ActionLink("About Us", "About", new { SectionId = 1 })%> Base Controller using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; n...

ASP.NET MVC model bind ID mismatch

Hi I have a View in MVC 2 where I edit a "Page". A Page has a Name, Title and Content. Content is of type EditableContent, which has Width, CssClass and Columns. Columns is a List. When I do this in the view: <%= Html.TextBoxFor(m => m.Name) %> It outputs the following HTML: <input type="text" value="About Page" name="Name" id="Nam...

Dynamically Generated Ajax.BeginForm

Hello, I have a problem with ASP.NET MVC Ajax forms. I generate several Ajax forms in a table, like this: <% foreach (var item in Model) { var statefulItem = item as StatefulEffectiveItem; %> <tr> <td> <% using (Ajax.BeginForm("ShowAddActivity", "EffectiveItems", new { id = item.Id }, new Ajax...

ASP.NET MVC Security checklist

There are tons of good papers about designing and developing for security (and even a bunch of posts on SO), but all of them seem to concentrate on what you should do. What I'm after, however, is a think-like-a-hacker checklist. A list of simple actions you should to go through once you're done with development, to make sure the soluti...

MVC: capture route url's and pass them to javascript function

Short:Is there a way to have a route-definition that will pass the "CONTROLLER/ACTION" string value to a javascript function in stead of actually going straight for the controller action? More:I have a masterpage which contains the navigation of the site. Now, all the pages need this navigation wrapped around it at all times, but becaus...

Is Cache Substitution working in ASP.NET MVC 2?

After upgrading an application from ASP.NET MVC 1 to ASP.NET MVC 2 RC cache substitution has stopped working. This is my action: [OutputCache(Duration = 30, VaryByParam = "none")] public ActionResult CacheTest1() { return View("CacheTest"); } This is the Substitute extensions: public static object Substitute(this HtmlHelpe...

ASP.NET MVC 2 RC areas and shared models

Once new area is created by the means of Visual Studio context menu, there are three folders: Controllers, Models, Views. Is it supposed that every area should have it's own model classes? Or is it acceptable/widely-used/good for all areas to share the same model classes in the root Models folder? My project differs Domain Model and Vi...

Rebinding a list of textboxes in ASP MVC2 VS2010 Beta2 after postback

So.. I have a problem. I'm sure almost anybody that tried MVC has had it. Nevertheless I've been unsuccessfull in googling a solution or thinking of one for my self. The problem is this: I have a list of textboxes that I'd like to edit all at once, and I'd also like to add new items to my list. However, the text binding fails after the ...

Best way to retrieve XML data in MVC?

If I am passing an XElement or XDocument to my ASP.NET MVC view, what's the best (read: easiest) way to repopulate my XML with the values returned from the edit form on submit? Thanks, Matt. ...