How to use gridView in Mvc without adding form runat server?

后端 未结 1 1126
遥遥无期
遥遥无期 2021-01-26 01:56

My question is too simple but puzziling. i have a develop a mvc pages to learn. i used Repeater server control.




        
1条回答
  •  温柔的废话
    2021-01-26 02:28

    What are you doing? Server side controls in an ASP.NET MVC application? Please don't. Stop this madness.

    No.

    The Repeater might work as it doesn't depend on ViewState but GridView -> forget about that. Also forget about Repeater. Also forget about anything that has runat="server" in an ASP.NET MVC application (except the content placeholders if you are using the WebForms view engine).

    In ASP.NET MVC you could use the WebGrid helper to render a grid. And you could replace your Repeater with Editor or Display templates.

    There really is no point of doing ASP.NET MVC if you need to use GridViews and stuff like that. Use a classic WebForm for this purpose.

    0 讨论(0)
提交回复
热议问题