MVC4 Check!Ispostback [英] MVC4 Check !Ispostback

查看:92
本文介绍了MVC4 Check!Ispostback的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查!ispostback for Mvc4 cshtml页面中的下拉列表。



如果有任何样品,请告诉我。



谢谢

Chinna

How to check !ispostback for dropdown list in Mvc4 cshtml page.

Please let me know if any samples.

Thanks
Chinna

推荐答案

ASP.NET MVC有一种完全不同的工作方式。在某种意义上,它更像是PHP,它是如何在客户端和服务器端共享应用程序的活动。

您可以通过多种方式填充下拉列表,这是您在此处可以看到的最常见的: a href =http://www.asp.net/mvc/tutorials/javascript/working-with-the-dropdownlist-box-and-jquery/using-the-dropdownlist-helper-with-aspnet-mvc> http ://www.asp.net/mvc/tutorials/javascript/working-with-the-dropdownlist-box-and-jquery/using-the-dropdownlist-helper-with-aspnet-mvc [ ^ ]

如果你想根据列表中的选择做一些事情,你应该使用ajax,参见下面的例子:http://blogs.msdn.com/b/rickandy /存档/ 2012/01/09 / cascasding-下拉列表,在-ASP净MVC .aspx [ ^ ]

但是你可以通过调用一个动作进行回发,但这在MVC中是最常见的方式,参见这个例子 [ ^ ](我有强调:不要这样做)
ASP.NET MVC has a totally different way of working. It is more like PHP in the sense how the activity of the application is shared between the client and the server side.
You have several ways to populate a dropdowlinst, the most common you can see here: http://www.asp.net/mvc/tutorials/javascript/working-with-the-dropdownlist-box-and-jquery/using-the-dropdownlist-helper-with-aspnet-mvc[^]
If you want to do something based on the selection in the list, you should use ajax, see following example: http://blogs.msdn.com/b/rickandy/archive/2012/01/09/cascasding-dropdownlist-in-asp-net-mvc.aspx[^]
You can however do a "postback" by calling an action, but it is most uncommon way in MVC, see this example[^] (I have to emphasize: don''t do that)


这篇关于MVC4 Check!Ispostback的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆