I am having an issue with MVC-3 generating outgoing routes for me. This is the address of the page I am on for both scenarios: [URL] Here are the map routes:
[Code]....
Scenario 1: From the controller: [Code].... From the view: [Code]....
The resulting link that gets created. [URL] If I change the controller code to read as follows:
[Code]....
I didn't make any changes in the view, only added those two lines to the controller and the following link is created: [URL] What am I missing here? This is consistent behavior, I was able to reproduce this in other areas of my application.
We need dynamic data passed to our layout file, no matter what the child view is. For example, we display some user specific data in the header of the layout.
How can we pass this data to the layout view without each action having to supply it independently? Should we use a custom controller, or is there a better solution?
I know there is a serial problem with the gridview in webform:
if the data is too much as 100 thousands rows and more, and we 'select * from tableName' and bind data to the girdview, when the girdview pagination to last page , it will crash out! Then we should use ' DataBase pagination ' way. so, we use Linq to sql,Linq to Entity etc. to fetch data from database, using ' DataBase pagination ' , the WebGrid won't crash and it will take a short pageload time.
Is there any good way of Linq to sql / Linq to Entity for DataBase pagination ?
This seems like a basic question, but my searches haven't turned up an answer. Is there a way to use a DataTable as the source for the WebGrid helper? The constructor wants an IEnumerable<dynamic>, which a DataTable is most definitely not.
I am using Razor and MVC 3 WebGrid in ASP.NET MVC 3 Beta.
I have the following:
[Code]....
I am not able to have two ActionLinks on the same column. In this case I get the following error:
The best overloaded method match for 'System.Web.Helpers.WebGrid.Column(string, string, System.Func<dynamic,object>, string, bool)' has some invalid arguments
This is usefull not just for this but to create columns that contains more information then just a field.
I also tried Razor's <text> but no luck ... Maybe I used it wrong.
we are testing the Razor webgrid with Ajax. Works absolutely fine in IE8 when sorting in paging. However in IE7, any attempt to sort or page causes the grid to vanish from the page, leaving a blank space. The HTML that should be there, isn't!Has anyone come across this issue? How could we debug it? Page code below:
I've been practicing with WebMatrix and I've come across this problem. I'd like to use the format property of the WebGrid Column in vbhtml but I can't get it to work. I always get some kind of compilation error. Mostly the compiler says that an expression is needed. There must be a crucial difference between the way it's done in cshtml and the way it's done in vbhtml.
My webGrid is working perfectly fine. However, I would like the default sort order to be in the opposite direction. If it were SQL, I'd be adding a DESC somewhere. Here's my working line of code:
[Code]....
It correctly sorts on the UWDate column, but I would like it to sort the opposite sort order. Of course, once it is displayed, you can click on the title and it will resort at that time.
I have a Car class that I'm trying to display in an MVC 3 view using the WebGrid helper. Below are the Car and it's metadata class.
Car class:
[MetadataType(typeof(CarMetadata))] public partial class Car { // car implementation } Car metadata class: public class CarMetadata { [DisplayName("Car Name")] [StringLength(100, ErrorMessageResourceType = typeof(ValidationText), ErrorMessageResourceName="CarNameDescriptionLength")] [Required] public string CarName { get; set; } }
View contents:
@model List<Car> ... var grid = new WebGrid(Model, canPage: true, rowsPerPage: 10); grid.Pager(WebGridPagerModes.NextPrevious); @grid.GetHtml( htmlAttributes: new { id = "grid" }, columns: grid.Columns( grid.Column("CarName", ?????) ));
GOAL: I'd like to figure out how to use the DisplayName data annotation as the column header text in the WebGrid (?????). Does anyone know how this is accomplished?
I am using a Webgrid as part of an MVC 3 app. The weird thing is the first display of the page with the grid displays fine but when I click on a heading to sort, the grid is not displayed as part of the page when I am running under the web server provided by the VS 2010 installation. When I do a View Source of that page, all of the grid stuff (as table elements) is there to be displayed. It just does not show up in the browser. So, I wrote the html to a file and copied the javascript and css files to the same folder and then ran the file under IE and everything displays as it should.
Just in general, where can I find the code to take a look at and learn from them? Or at least look at the functions available to me as I do get the feeling that the insufficient documentation at the moment reveals all.
right now I playing around with WebMatrix and I followed the tutorial from http://www.asp.net/WebMatrix. Chapter 6 (displaying data in a grid) described how to use a WebGrid helper very clear, but the data in the example is always retrieved from an SQL DB.I want to use the same XML file from chapter 7 (Displaying data in a chart).Using the code:
... var DataSet = new DataSet(); dataSet.ReadXmlSchema(Server.MapPath("/App_Data/QCFiler.xsd"));