简体   繁体   English

如何在 Asp.net MVC 和 c# 中使用服务器控件

[英]How to use server controls in Asp.net MVC with c#

how to use server controls in asp.net mvc.如何在 asp.net mvc 中使用服务器控件。

Controls like: dropdown, grid etc...控件,如:下拉,网格等...

please give me a refernece or a sample.请给我一个参考或样品。

Is postback is supports?回发是支持吗? in mvc.在 mvc 中。

and also please provide a reference link for advance level of asp.net mvc.还请提供 asp.net mvc 高级级别的参考链接。 and MVC Projects和 MVC 项目

answer is: you can't.答案是:你不能。 refer to basic asp.net mvc article and try to understand the difference the mvc stands for before movign into advanced level.请参阅基本的 asp.net mvc 文章,并在进入高级级别之前尝试了解 mvc 所代表的区别。

this might be a good starting point. 可能是一个很好的起点。 and these tutorials are pretty good too.这些教程也很不错。

and no- postbacks are not supported.并且不支持无回发。

You shouldn't be using server controls in MVC.您不应该在 MVC 中使用服务器控件。 You can just about, but it's entirely the wrong model.你可以,但它完全是错误的 model。

When you ask are postbacks supported, the answer is yes & no.当您询问是否支持回发时,答案是肯定的和否定的。 A post back is just a post to the server, so yes, you can see that request and respond.回发只是发给服务器的帖子,所以是的,您可以看到该请求并做出响应。 However the complex event handling present in webforms isn't supported.但是,不支持 Web 表单中存在的复杂事件处理。 Controllers won't raise events, and views don't have code behinds.控制器不会引发事件,视图也没有代码隐藏。

It's better to use the MVC way of generating drop-downs, grids etc.最好使用MVC的方式生成下拉、网格等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM