c# - How to assign Datagrid DataSource to Model with ASP.NET MVC FrameWork -


Using ASP.NET MVC, I am able to use the model as:

  & lt; % Foreach (Miscellaneous items in the model) {%> & Lt; TR & gt; & Lt; TD & gt; & Lt;%: Html.DisplayFor (model item = & gt; items.companyname)% & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt;%}% & gt;   

So can I allocate the datagrid data source like this? Let's say:

  & lt; ASP: DataGrid ID = "DataGrid1" Runat = "Server" Datacsource = "& lt;% Model% & gt;" />  

I think you are mistakenly considered as ASP.NET MVC.

  does not support ASP.Net MVC Server Side Control   

This is only supported in web-form, asp.net web-form comparison In the programming model is completely different.

All server side control uses viewstate , which is not supported by asp.net mvc.

If you want to get grid functionality, you can go to asp.net MVC WebGrid or you can open Java Script Open Source Library such as < You can use pre> Jqgrid, jquery data tables, etc.

Before this, you start working with ASP.x MVC ,

  I strongly recommend you to webform and I advise to understand the difference between MVC, which supports control etc.    Note: You can not use ASP.NET Server Control in ASP.NET MVC   

Renewed:

Here, the link that gives you a distinction between the webform and the MVC < / Html>

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -