tagged [asp.net-mvc-3]

Action Image MVC3 Razor

Action Image MVC3 Razor What is the best way to replace links with images using Razor in MVC3. I simply doing this at the moment: Is there a better way?

21 Feb at 02:46

Current date and time - Default in MVC razor

Current date and time - Default in MVC razor When the MVC view page with this textbox, loads , I would like to display current date and time by default. How can I do this? in razor.

Specify size and maxlength for Html.TextBoxFor

Specify size and maxlength for Html.TextBoxFor I need to change the size of textbox : I tried this but doesn't work.

22 Feb at 13:47

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...

Run command line code programmatically using C#

Run command line code programmatically using C# I'm using this code run in windows command prompt.. But I need this done programmatically using C# code > C:\Windows\Microsoft.NET\Framework\v4.0.30319>...

12 Nov at 08:34

What is the @Html.DisplayFor syntax for?

What is the @Html.DisplayFor syntax for? I understand that in Razor, @Html does a bunch of neat things, like generate HTML for links, inputs, etc. But I don't get the DisplayFor function... Why would ...

15 Jun at 23:30

How to create a readonly textbox in ASP.NET MVC3 Razor

How to create a readonly textbox in ASP.NET MVC3 Razor How do I create a readonly textbox in ASP.NET MVC3 with the Razor view engine? Is there an HTMLHelper method available to do that? Something like...

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

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?

How to show Alert Message like "successfully Inserted" after inserting to DB using ASp.net MVC3

How to show Alert Message like "successfully Inserted" after inserting to DB using ASp.net MVC3 How to write a code for displaying the alert message: "Successfully registered", after user data is stor...

What colon ( : ) means defining a class in c#?

What colon ( : ) means defining a class in c#? In c# defining a class what does `:` means? As example, in this very basic controller of an ASP.NET MVC application: In the third line, what does `: Cont...

3 Mar at 20:11

Autofac - InstancePerHttpRequest vs InstancePerLifetimeScope

Autofac - InstancePerHttpRequest vs InstancePerLifetimeScope What are the differences between the two scopes? I am building `Module`(s) in each layer (Repository, Service, MVC App), but in order to ha...

"Who is online" feature with ServiceStack

"Who is online" feature with ServiceStack I am trying to build a basic "who is online" feature with ServiceStack. Session Caching is defined as follows: Is there a way filter collection of sessions by...

17 Aug at 05:31

How to use TagBuilder in a Class Library project?

How to use TagBuilder in a Class Library project? I am trying to use `TagBuilder` in a Class Library project. I have added references to `System.Web` and `System.Web.Mvc`(v3), but in my class file the...

29 Jan at 20:3

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?

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

Entity Framework multiple counts with a single query

Entity Framework multiple counts with a single query Sorry if this has been asked, but how can I improve the following with a single call to the database?

ASP.NET MVC 3 Razor: Include JavaScript file in the head tag

ASP.NET MVC 3 Razor: Include JavaScript file in the head tag I'm trying to figure out the proper Razor syntax to get a JavaScript file for a particular *.cshtml to be in the head tag along with all th...

Passing an object to HTML attributes

Passing an object to HTML attributes How to pass an object to HTML attributes? For example I have the following code: How to convert attrs to string like this to embed them into an HTML markup: Thanks...

11 Jul at 10:18

Model Validation to allow only alphabet characters in textbox

Model Validation to allow only alphabet characters in textbox How can I annotate my model so I can allow only alphabets like A-Z in my text-box? I know that I can use regex but can anyone show how to ...

How do I access ViewBag from JS

How do I access ViewBag from JS My attempted methods. Looking at the JS via browser, the `@ViewBag.CC` is just blank... (missing)

Where can I find System.Web.MVC dll in a system where MVC 3 is installed?

Where can I find System.Web.MVC dll in a system where MVC 3 is installed? I want to know where I can find the `System.Web.MVC` dll in a system, where MVC 3 is already installed. I want to it on an X64...

28 Aug at 12:59