Linked Questions
16 questions linked to/from RAZOR MVC3: Partial View to Reuse
337 votes
3 answers
190k views
How do I specify different Layouts in the ASP.NET MVC 3 razor ViewStart file?
I would like to have 2 separate Layouts in my application. Let's say one is for the Public section of the website and the other is for the Member side. For simplicity, let's say all the logic for each ...
28 votes
6 answers
19k views
To WebGrid or not to WebGrid...what is the answer?
I'm reading and hearing some pain points and am wondering if I should even go that route. Not to mention, I cannot seem to find any definitive documentation (from Microsoft). If you say I shouldn't ...
19 votes
8 answers
44k views
Using data in a HTML.ActionLink inside a WebGrid.column, not possible?
I have the following WebGrid in my ASP.NET MVC3 test application. It displays a list of customers: @grid.GetHtml( tableStyle: "grid", headerStyle: "head", alternatingRowStyle: "alt", columns: grid....
11 votes
10 answers
49k views
How to make a MVC 3 Webgrid with checkbox column?
The code below will insert an actionlink into one of the web grids' columns. @{ View.Title = "Index"; Layout = "~/Views/Shared/_Layout.cshtml"; var usersGrid = new WebGrid(source: ...
10 votes
1 answer
21k views
Conditionally display an image in webgrid - mvc 3
In my webgrid I need to display images based on the value .. Code is given below @model TraktorumMVC.Models.ManagePhotos @{ ViewBag.Title = "ManagePhotos"; Layout = "~/Views/Shared/_Layout....
6 votes
7 answers
20k views
Mvc 3 texbox in webgrid (razor)
Simple Q:How do you I get the textbox to show the value. Code below fail on item.LastName @model List<Mvc2010_11_12.Models.Employee> @{ var grid = new WebGrid(source: Model,defaultSort: "...
11 votes
1 answer
4k views
When do I use View Models, Partials, Templates and handle child bindings with MVC 3
new to mvc3, i have a few questions, would appreciate if someone could answer/provide links: When should I use View Models? Is it not recommended to use the domain? I find that my view models are ...
3 votes
4 answers
10k views
How to hide header on MVC3 WebGrid
Is there some easy way to hide header for MVC3 WebGrid extension? Something like var grid = new WebGrid(Model, canSort:false, canPage:false, showHeader:false); I can probably set css style for ...
5 votes
1 answer
10k views
Razor Nested WebGrid
How do I have nested WebGrid with lot of formatting for each column. I can do a nested for-loop, but I need it basically for paging. Or is there any other better option?
3 votes
4 answers
16k views
ASP.NET MVC3 RAZOR: Redirecting from Partial Views
I have two partial views “MyPopular” and “MyBlogs”. And there are two controllers – “ArticleController.cs” and “ThePopularController.cs”. Both these partialviews contains buttons. Initially it ...
1 vote
3 answers
6k views
ASP.NET MVC partial views and redirecting
I have a partial view called Login.ascx that has my login boxes that I include on a number of pages throughout my site. It works fine when the information is correct but I'm trying to do validation so ...
4 votes
1 answer
3k views
Is the MVC WebGrid Open Source?
Is the MVC WebGrid Open Source? If so where can I find the source code. The current version of the WebGrid has little to no documentation, incomplete implemtation etc. I am trying to do a simple ...
1 vote
1 answer
3k views
htmlhelper inside webgrid
I'm using MVC3 and I need a HTMLHelper with image, so I found a nice code, the problem is that the image is not shown instead of I see html code ex: <a href='whatever'><img src="images/...
3 votes
1 answer
3k views
How can I hide a WebGrid column based on the current user's role?
I need to do a grid using webgrid and I would like to hide the column (header and items) of edit actions based on user role. How can I do that with webgrid?
1 vote
2 answers
550 views
How do I render an alternate child view in MVC?
I'm new to working with MVC so please don't assume I know anything. I am picking up a project that has much already written in MVC and I am trying to add some things to it. On one View there is a ...