tagged [asp.net-mvc]

How to set ID and Text in html.label helper in mvc2

How to set ID and Text in html.label helper in mvc2 I want to set ID and Text attribute in html.label helper in mvc2 Plz help me out..

28 Aug at 07:25

What is the MVC Futures Library?

What is the MVC Futures Library? On Stack Overflow, I've seen a few people referring to the [MVC Futures library](http://aspnet.codeplex.com/releases/view/24471) What is this project? How do I use it?...

Pass viewbag to partial view from action controller

Pass viewbag to partial view from action controller I have a mvc view with a partial view.There is a ActionResult method in the controller which will return a PartialView. So, I need to pass ViewBag d...

ASP.NET MVC4 List of all areas

ASP.NET MVC4 List of all areas I have an ASP.NET MVC4 application in which I am creating multiple areas, is there a way I can find out programmatically the number of areas that are present and their n...

Aspx to Razor syntax converter?

Aspx to Razor syntax converter? I have a considerable amount of ASPX and ASCX files writed in C# for MVC and I would like to convert them to the new Razor syntax. Any body knows about some utility tha...

7 Jan at 09:29

What does Html.HiddenFor do?

What does Html.HiddenFor do? Although I have read the documentation on Html.HiddenFor, I've not grasped what is it used for... Could somebody explain its uses and give a short example? Where should th...

How to get query string parameter from MVC Razor markup?

How to get query string parameter from MVC Razor markup? I want to check the URL parameter in my Razor markup. For example, how do I do something like this:

ValidateAntiForgeryToken purpose, explanation and example

ValidateAntiForgeryToken purpose, explanation and example Could you explain [ValidateAntiForgeryToken](http://msdn.microsoft.com/en-us/library/system.web.mvc.validateantiforgerytokenattribute%28v=vs.1...

25 Feb at 09:37

asp.net mvc 3 razor. navigate to view on table tr click

asp.net mvc 3 razor. navigate to view on table tr click I have users list table how i can navigate on url: "../users/showprofile?userid=" I want to make table when user clicks on table row navigate on...

How to add row number to kendo ui grid?

How to add row number to kendo ui grid? I have a kendo ui grid in my page that has some columns. Now I want to add a column to it that shows me row number. How to I do this? Thanks.

Difference between Interface and Abstract class in terms of Decoupling?

Difference between Interface and Abstract class in terms of Decoupling? As we know there are basically two important difference between Interface and Abstract class. 1. We can have function definition...

Run a method in each request in MVC, C#?

Run a method in each request in MVC, C#? In WebForm we could write a method in MasterPage.cs and it ran in each request . e.g: How can we do something like this in MVC ?

17 Jul at 00:39

Session Management in MVC

Session Management in MVC I am new in MVC. I am creating new WebApplication in MVC4 Razor. I want to maintain User Login session for all pages. Can any one Explain me how to maintain session for all v...

MVC 3 Display HTML inside a ValidationSummary

MVC 3 Display HTML inside a ValidationSummary I am trying to display a strong tag inside a validation summary but it encodes it and does not display properly. How can I get this to work?

Difference between "MapHttpRoute" and "MapRoute"?

Difference between "MapHttpRoute" and "MapRoute"? Why using "MapRoute" for "Default" routing, while using "MapHttpRoute" for "DefaultApi" routing? ``` routes.MapHttpRoute( name: "DefaultApi", routeT...

What is the difference between @Html.ValueFor(x=>x.PropertyName) and @Model.PropertyName

What is the difference between @Html.ValueFor(x=>x.PropertyName) and @Model.PropertyName It seems like these two Razor commands do the exact same thing. Is there any special circumstance or benefit of...

asp.net mvc Bundle.IncludeDirectory example?

asp.net mvc Bundle.IncludeDirectory example? Hi Can anyone give me an example on how to use Scriptbundle method IncludeDirectory for Javascripts, not able to get how to write the search pattern string...

Adding style to Editor For

Adding style to Editor For I'm trying to apply a Style to the Editor for an element, but I can't make it work; what am I doing wrong?

Routes.AppendTrailingSlash exclude some routes

Routes.AppendTrailingSlash exclude some routes In MVC 5.2.2 I can set `Routes.AppendTrailingSlash` to true so that trailing slash are appended to urls. However I also have a robots controller which re...

Using ModelBinder attribute vs. ModelBinders.Add()

Using ModelBinder attribute vs. ModelBinders.Add() Can someone tell me the pros/concs to using `[ModelBinder()]` attribute vs. registering model binders via `ModelBinders.Add()` in global.asax? One ad...

Learn asp.net mvc 3 from open source project

Learn asp.net mvc 3 from open source project I want to learn ASP.NET MVC 3 (C#) by studying open source projects. Do you guys have any recommendations? I want to find a project that's written in MVC 3...

28 May at 02:32

what is the difference between ViewData & PageData in asp.net MVC 3?

what is the difference between ViewData & PageData in asp.net MVC 3? Well i see this 2 properties but i cant understand the difference between them? I cant seem to find any help anywhere about the Pag...

7 Aug at 18:34

How to use MVC 3 @Html.ActionLink inside c# code

How to use MVC 3 @Html.ActionLink inside c# code I want to call the @Html.ActionLink method inside a c# function to return a string with a link on it. Something like this:

How can I use Html.Action?

How can I use Html.Action? I am trying to understand how to use: What I would like to do is to pass a call to my controller and pass the parameters: Can someone explain how I can do that with the Html...

16 Jan at 00:56

MVC MapPageRoute and ActionLink

MVC MapPageRoute and ActionLink I have created a page route so I can integrate my MVC application with a few WebForms pages that exist in my project: ``` public static void RegisterRoutes(RouteCollect...