asp.net-mvc-2

show dynamically selected columns in asp.net mvc grid at runtime

hi, I have an asp.net MVC application where I am using telerik grid to show the data/records.I am using the Entity Model. My requirement is that sometime I want to show only some of the columns specified at the runtime/may the user select. How do I bind View with only those columns as selected by the user . Initially view is binded wit...

Trouble with ASP.NET MVC SelectList with IEnumerable<DateTime>

As usual, having trouble with SelectList in the MVC framework. The selected value is never set for some reason: public class MyViewModel { public DateTime? SelectedServiceTime { get; set; } public IEnumerable<DateTime> AvailableServiceTimes { get; set; } public SelectList ServiceTimesList { get { ...

Detecting a direct post to a Controller Action

Is there a way of detecting if a Controller is getting posted to directly, or the action is a result of a previous form being posted? ...

Using NServiceBus with Asp.Net MVC 2

Is there a way to using NServiceBus with Asp.Net MVC 2? I want to send a request message from a Asp.Net MVC2 Application to a Service, which handle the message and reply with a response message. is there a way to do this clearly? ...

How to get the complete request that calls my MVC2 controller?

Newbie question … sorry ;-) I have to write and to integrate a new website in a complex web application. My new (MVC2) website will be hosted on a separate server and only called when the user clicks on a link in the already existing, complex website. Means I(!) define the URL which calls my(!) new website. But “they” (the calling,...

asp.net mvc client side validation for camel case property name

Hi all, I am using the MS shipped client side validation in asp.net mvc 2. The model in question has one property called "FirstName". Our client side developer really like to have camel-case in the elements id, so instead of using the normal html helper Html.TextBoxFor(m => m.FirstName), we wrote out the html input view instead like: ...

Confirmation dialog on an ActionLink using ASP.NET MVC 2

Does anyone know how to add a confirmation dialog with an "actionlinkwithimage"? ...

Reusing ajax result asp.net mvc

Hello Everyone, i want to implement ajax functionality like google has done here. this is a transliteration application where user types word in roman and after he/she presses space it sends an ajax call to server bringing back list of probable output words in native script of the language (Urdu in my case). when writing text when i wri...

caching ajax result on client side asp.net mvc2

Hello everyone, i want to do something like this is screenshot of google transliterator that can be found here. in this application user writes in roman script and when he/she presses space an ajax request goes to server bringing back list of words. roman word is then replaced by word top in the result list (Urdu result list in my ca...

best way design Country(City) select list and store current country(city) in asp.net mvc

I have asp.net mvc app. In header on all pages I have dropdownlist with list cities. Content on pages show with depend what city is select. I want show selected once city on every page and want save and restore this city from cookie when browser is close. What the best solution for this? ...

asp.net mvc 2 access viewdata dictionary from custom metadata provider

I have a custom metadata provider that inherits from DataAnnotationsModelMetadataProvider. I am wondering how (if possible) I add data to the ViewData dictionary from the custom metadata provider class? Thanks! ...

Strongly Typed Views - post additional data via edit/create form.

Hi all, I have a simple (hopefully) scenario. Seats table Computers table SeatComputers table (since a seat can have multiple computers assigned) I have a strongly typed "Edit" view for "Seats". I have managed to get a multi select list on that page in order to assign or unassign computers (jquery to add/remove items). However, w...

asp.net mvc modifying master file from a view

I need to add class attribute to the body tag from a view file (.aspx), but the tag is in the master file. How can I access the body tag from a view? ...

How to use JqGrid TreeGrid in MVC.NET 2?

Hi, theres not that much information over internet on how to use Trirand JqGrid TreeGrid option with MVC2. Anybody with an example? ...

ASP .NET Membership with Entity Framework

How is everyone designing their EF models when using the built in ASP .NET Membership functionality? I have many entities (blog posts, comments, photos, etc.) which have a user id associated with them. I currently have a User model that maps to the aspnet_User table, but there is lots of sketchy code juggling around both the MembershipU...

What is the default behaviour of a controller action not marked with AcceptVerbs, HttpGet or HttpPost?

If I create a controller action and do not decorate it with AcceptVerbs, HttpPost or HttpGet. What is the default behaviour? Does the action allow any access method or does it default to GET? ...

How to detect your site's domain name?

I don't know if question in the title was clear enough. Let's say that you have 2 or N domains pointing on the same ip address, your server (in my case Windows Server with IIS) and you want to make custom site for every domain name so you have to detect which domain is user currently using. There should be two "custom sites". One is Ad...

OData WCF Data Services - Related data (by foreign key) doesn't show up when calling the service

When I get the data using the URL in browser, I'm able to see the related data, for example: http://localhost/services.svc/Dinners(1)/RSVPs That lists 5 RSVPs for DinnerId = 1 in my case, but when I'm consuming the OData from a different project, I can only retrieve Dinners, debugging the app shows that RSVPs = 0, while it should be 5....

Entity Framework CTP4: where to put SetInitializer?

I am attempting to add Entity Framework, code first, to an MVC application that's been running with test data, using the CTP4 preview. I am currently getting this error: The model backing the 'SchedulerContext' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializ...

ASP.NET MVC SiteMap samples

I just did downloaded it from codeplex http://mvcsitemap.codeplex.com/ and can’t make it work properly, there is no so good samples around. I need to display sitemap sections depending on action. Should i define multiple sitemaps, in such case the question is how to pass this paths to SiteMap control dynamically File 1: <siteMap> <s...