asp.net-mvc

ASP.NET MVC 2 and authentication using WIF (Windows Identity Foundation)

Are there any decent examples of the following available: Looking through the WIF SDK, there are examples of using WIF in conjunction with ASP.NET using the WSFederationAuthenticationModule (FAM) to redirect to an ASP.NET site thin skin on top of a Security Token Service (STS) that user uses to authenticate (via supplying a username and...

Spark engine without master page

I use application.spark file for master page In my app i have login page that does not need master page I tried remove master page from my login page using this tag , but it continue to use application.spark I can fix it by adding new master page in layout folder with name blank.spark file without any code and in my login page put this...

readonly in asp.net mvc

How do I make a textbox read only in mvc? I have included the following snippet, but it`s not working. <%=Html.Textbox("test", "test", new { style="border: 0px; width:280px" ;readonly=true}%> ...

Add controls dynamically on button click in asp.net mvc

Hello All: I am creating an asp.net MVC application in which I want to provide a functionality to add a controls dynamically. I have a form in which there are 2 text boxes for First Name and Last name which serve as a single control. Now an user can add any number of this group of controls. I am able to add these controls on the page us...

Difference between Url.Action and Html.RenderActionLink and Html.RenderAction

Whats the difference between Url.Action and Html.RenderActionLink in asp.net mvc? ...

Html.ActionLink showing query url instead of pretty url.

The Html.ActionLink <li> ${Html.ActionLink<HomeController>(c => c.Edit(ViewData.Model.Id, ViewData.Model.Title), "Edit")} </li> When created as html shows the URL to be Edit/5006?title=One . How do I change this to a pretty URL like Edit/5006/One ? My Edit Action method is public ActionResult Edit(int id, string title) ...

Is there some "is valid" flag for ASP .NET MVC client side validation?

Hi. In my asp mvc application I use standard client side validation (DataAnnotations + MicrosoftAjax.js + MicrosoftMvcValidation.js). I need to show some popup message (jGrowl) after successful/unsuccessful client side validation (so I can't use ModelState.IsValid). So I search for some standard flag which indicates client side validati...

Client (sorting/paging) grid for asp.net mvc

Anyone know about a client side grid for asp.net mvc? I read this post but I didn't find it. ...

How can I access form elements when using an ASP.NET MVC Ajax form?

I've got an ajax form in an MVC 2 application. I cannot find the proper way to access the form elements within the Ajax form decleration. I can access the name of the elements with Request.Form.Keys but I can't access the actual values. I've read numerous examples of posting forms with jQuery but my form has elements created dynamically ...

ASP.NET MVC - How to save some data between requests ?

Hi, I'm trying to solve the problem: when a user is being logged into a WebSite (via user control .ascx stored on the Master Page), it's name is being stored in a Page.User.Identity.Name property. OK, but how to retrieve that user name in the controller ? Is it possible without registering System.Security.Principal namespace in the cont...

Using multiple databases within one application

I have a web application made for several groups of people not connected with each other. Instead of using one database for all of them, I'm thinking about making separate databases. This will improve the speed of the queries and make me free from checking to what group the user belongs. But since I'm working with LINQ to SQL, my clas...

How do I Validate Email or Phone requirement in MVC?

In MVC I am using [Required(ErrorMessage="")] to validate my text. How do I utilize a validation for an "Email or Phone Contact" textboxes in my model? I now have the validation in my controller, which I would like to have in the model. CONTROLLER... if (insuredInfo.InsuredHPhone == null && insuredInfo.InsuredWPhone == null...

Bulk email notifications API for social networking site

I'm looking to build a social networking site that notifies followers of a particular user when new content has been posted by that user. Since the hope is that the site will eventually have thousands of users with thousands of followers, I'd prefer to use an outside product/service to send the emails rather than building the functional...

MVC Areas - View not found

Hi, I have a project that is using MVC areas. The area has the entire project in it while the main "Views/Controllers/Models" folders outside the Areas are empty barring a dispatch controller I have setup that routes default incoming requests to the Home Controller in my area. This controller has one method as follows:- public ActionR...

MVC 2 Conversion Disrupts the parameters passed to my Stored Procedure

I have a few textboxes that are not required. If the user enters nothing it is passed as 'null' in MVC 2. It was passed as '""' in MVC 1. What changes can I make to accomodate for this? public string Name { get; set; } public string Offer{ get; set; } public string AutoID { get; set; } using (SqlConnection conne...

ASP.NET MVC 2.0 Validation and ErrorMessages

I need to set the ErrorMessage property of the DataAnnotation's validation attribute in MVC 2.0. For example I should be able to pass an ID instead of the actual error message for the Model property, for example... [StringLength(2, ErrorMessage = "EmailContentID")] [DataType(DataType.EmailAddress)] public string Email { get; s...

Why is the HttpContext.Cache count always zero?

I set up a few pages with OutputCache profiles and confirmed that they are being cached by using multiple browsers and requests to retrieve the page with a timestamp which matched across all requests. When I try to enumerate the HttpContect.Cache it is always empty. Any ideas what is going on here or where I should be going for this ...

What advantages does Mvc jquery validation offer?

What advantages, if any, does MVC jQuery Validation offer over the built-in MVC client validation? I've used the built-in validation and am just curious as to if I'm missing anything or not. ...

Asp.net override Membership settings at runtime (asp.net mvc)

I had an application that hooked onto 1 single database. The app now needs to hook into multiple databases. What we want to do is, using the same application/domain/hostname/virtual dir give the user the option on the login screen to select the "App/Database" they want to connect into. Each database has the App tables/data/procs/etc a...

Routing to the actions with same names but different parameters

I have this set of routes: routes.MapRoute( "IssueType", "issue/{type}", new { controller = "Issue", action = "Index" } ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Hom...