asp.net-mvc-2 Questions

3

Solved

I know that I can use the filterContext to get to it. However, this is not very flexible if the action method parameter is named differently. This should work: [HttpGet] [NewAuthoriseAttribute(Som...
Mme asked 20/3, 2013 at 17:36

3

Solved

I have a controller action that downloads a file from an azure blob based on the container reference name (i.e. full path name of the file in the blob). The code looks something like this: public ...
Rafferty asked 23/6, 2011 at 7:7

5

Solved

Given an HttpContext (or HttpContextBase), is there a way to get an instance of the Controller?
Osithe asked 14/3, 2011 at 17:59

21

Solved

I have a controller that is being called twice from an ActionLink call. My home page has a link, that when clicked calls the Index method on the Play controller. An id of 100 is passed into the m...
Kappenne asked 1/5, 2010 at 18:43

13

Solved

Can I set the width of an EditorFor control on my View? I have set a few parameters: [Required, DisplayName("Payee Name"), StringLength(50)] public string Name { get; set; } However, I can't se...
Cholon asked 18/1, 2011 at 5:55

12

Solved

I'm iterating a List<T> in a razor foreach loop in my view which renders a partial. In the partial I'm rendering a single record for which I want to have 4 in a row in my view. I have a css c...
Ambrosia asked 26/4, 2012 at 2:24

9

Solved

I removed a project in my solution and then later re-added it. Since reading it.. I'm getting an ambiguous reference error now which I can't remove. viewing the implementation of the class (which i...
Alethaalethea asked 16/3, 2011 at 13:16

5

Solved

In an ASP.net MVC 2 app that I have I want to return a 204 No Content response to a post operation. Current my controller method has a void return type, but this sends back a response to the client...
Men asked 22/12, 2010 at 20:50

21

Solved

I have implemented in my app the mitigation to CSRF attacks following the informations that I have read on some blog post around the internet. In particular these post have been the driver of my im...
Theona asked 2/11, 2010 at 0:39

16

Solved

This is happening when I try to create the entity using a Create style action in Asp.Net MVC 2. The POCO has the following properties: public int Id {get;set;} [Required] public string Message {...
Parasang asked 26/1, 2010 at 22:1

8

Solved

I am working in progress bar concept in ASP.NET MVC 2. Here i have a DropDownList which has 10 values. i want to calculate the percentage for progress bar, e.g. 10 values from DropDownList and i am...
Diffidence asked 30/12, 2010 at 9:16

3

Solved

I can decorate an action either with the [AcceptVerbs(HttpVerbs.Post)]/[AcceptVerbs(HttpVerbs.Get)] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(string title) { // Do Something... } ...
Augmentative asked 2/10, 2010 at 0:39

3

Solved

I want to create an IRouteConstraint that filters a value against possible values of an enum. I tried to google it for myself, but that didn't result in anything. Any ideas?

7

In trying to get my application to produce 404 errors correctly, I have implemented a catch all route at the end of my route table, as shown below: routes.MapRoute( "NotFound", _ "{*url}", _ N...
Esoteric asked 22/10, 2010 at 21:25

6

Solved

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. @Html.EditorFor(model => model.ReturnDate)

4

Solved

I keep getting this error when I try to run a web app that I have inherited. It was written in 2010 for C# 3.5 and uses Mvc 2. I have installed the necessary libraries however I get this error. ...
Boiler asked 2/3, 2012 at 14:50

8

Solved

I've an Admin area and I want only Admins to enter the area. I considered adding the Authorized attribute to every controller in the Admin area. Isn't there an elegant solution or is this feature n...

11

Solved

I am having trouble displaying an background image in my ASP.NET MVC 2 application. Currently, In ~/Views/Shared/Site.master, I set my link to the style sheet to: <link href="<%:@Url.Content...
Milissa asked 22/3, 2012 at 12:5

3

I'm having trouble with a specific constraint I'm trying to set up on a route. My URL must look like this one: http://hostname/id-my-title-can-be-that-long where id is composed with digit only and ...
Rufe asked 30/12, 2010 at 8:57

5

Solved

I want something like this but with a slight change. I want a Button to be enabled or disabled on Checkbox checked event, i.e. when checkbox is checked then and then only button should be enabled o...
Ablative asked 27/5, 2011 at 8:53

14

Solved

I am working on Asp.net MVC 2 app with c# by using vs 2010.I am having below mentioned error when I run my app locally under debug mode. Error message image is as below : Error message text is...
Mogilev asked 15/1, 2013 at 8:59

4

Solved

I am checking my database in Create(FooViewModel fvm){...} to see if the fvm.prop1 and fvm.prop2 already exist in that combination; if so, I want to add an error to the modelstate, then return the ...
Bondy asked 21/4, 2011 at 4:0

4

Solved

I have small design question about html.DropDownListFor() How can I change width of html.DropDownListFor() ?? For example by css. Thanks for answers
Lollygag asked 15/6, 2010 at 22:22

9

Solved

Could someone please clarify something for me. In my ASP.NET MVC 2 app, I've got a BaseViewModel class which includes the following method: public virtual IDictionary<string, object> GetHtm...
Theocritus asked 11/2, 2011 at 13:5

9

Solved

I would like to redirect all www traffic to non-www traffic I have copied this into my web.config <system.webServer> / <rewrite> / <rules> <rule name="Remove WWW prefix&q...
Linolinocut asked 7/7, 2010 at 17:32

© 2022 - 2024 — McMap. All rights reserved.