Tagged Questions
43
votes
1answer
8k views
How do I access the ModelState from within my View (aspx page)?
How do I access the ModelState from within my View (aspx page)?
33
votes
2answers
7k views
Generic Inherited ViewPage<> and new Property
Setup:
CustomViewEngine
CustomController Base
CustomViewPage Base (in this base, a new property is added "MyCustomProperty")
Problem:
When a view is strongly typed such as: <@ Page ...
24
votes
15answers
3k views
ASP.NET MVC reminds me of old Classic ASP spaghetti code
I just went through some MVC tutorials after checking this site out for a while. Is it just me, or does MVC View pages bring back HORRIBLE flashbacks of Classic ASP spaghetti code with all the ...
21
votes
2answers
21k views
ASP.NET MVC - View with multiple models
I am trying to generate such HTML
<form action="/some/process" method="post">
<input type="hidden" name="foo.a" value="aaa"/>
<input type="hidden" name="bar.b" ...
19
votes
3answers
6k views
17
votes
6answers
5k views
Client Id for Property (ASP.Net MVC)
I'm a begginer in asp.net mvc, and I have a doubt:
I'm trying to do a label for a TextBox in my View and I'd like to know, how can I take a Id that will be render in client to generete scripts... for ...
10
votes
1answer
9k views
MVC3 Html.HiddenFor(Model => Model.Id) not passing back to Controller
I have created a strongly typed MVC3 Razor view using the scaffolding code.
The model is a POCO with a base type of PersistentEntity which defines a property called Created, Updated and Id.
Id is an ...
9
votes
2answers
6k views
Access application settings from ASP.Net MVC View
In an ASP.Net MVC 1.0 applicati0n, is it possible to access the application settings (MyProject.Properties.Settings.Default.*) from inside my View (aspx page)?
I've tried but the intellisense and ...
8
votes
3answers
10k views
How do I construct an if statement within a MVC View
Hopefully this question is quick and painless
I have a mvc view where i want to display either one of two values depending on an if statement. This is what I have in the view itself:
<%if ...
8
votes
1answer
6k views
MVC Navigate to different controller view
I'm having trouble navigating to a different controller view from another controller action.
e.g. return view("edit", "profile", profile);
I'm trying to navigate from the account controller to the ...
8
votes
4answers
7k views
MVC3 pass @model to partial view
I have two partial views which are exactly the same, but for the @model.
@model Project.Models.X
@model Project.Models.Y
How could I pass this model type to the view so that I can use the same view ...
8
votes
2answers
2k views
MVC Preview 5 - Rendering A View To String For Testing
I was reading a post by Brad Wilson (http://bradwilson.typepad.com/blog/2008/08/partial-renderi.html) on the new ViewEngine changes to MVC Preview 5 and thought that it would be great to be able to ...
8
votes
1answer
1k views
MVC Render Speedup
I just hooked up the mvc-mini-profiler (thanks SO!) on my site and was looking around to see how well I've done up to this point (it's my first major bout with linq to entities and mvc). So far ...
7
votes
2answers
1k views
ASP.NET MVC one route, two different views
I'm trying to design a homepage for an MVC site that has two different views, based on if the user is logged in or not.
So image the default (not logged in) view is showing general, nonspecific info. ...
7
votes
2answers
3k views
possible to share views across multiple mvc 3 projects
I am building several different asp.net mvc 3 web projects all under one solution. I'd like to be able to utilize a few views across all of those projects as they're all going to be displaying the ...