如何在ASP中获取选择标记的选择值? [英] How to get selected value of select tag in ASP?

查看:481
本文介绍了如何在ASP中获取选择标记的选择值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在ASP中获取选择标记的选择值?
当页面重新加载时,选择标记以起始值开头
请回答我

How to get selected value of select tag in ASP?
and when page reload select tag start with starting value
plz reply me

推荐答案

您的问题的框架不正确-语句,标签等.但是,听起来您正在使用Web应用程序,并且下拉列表正在重置回发.一定是因为重新绑定了回发上的下拉列表.只需使用VS DEBUGGER,您就可以自己使用它.如果您谈论的是ASP.NET,则可以使用Page属性IsPostback以避免在回发时重新绑定.

完成此操作后,您可以使用SelectedIndex/SelectedValue左右选择的值,具体取决于您使用的控件.只需对下拉列表进行快速监视,其中一个属性应保存所选值.

试试吧!
Your question is not framed well - statement, tags etc. Yet, it sounds like you are working on a Web application and the dropdown is resetting on postback. It must be because of rebinding of dropdown on postback. Just use VS DEBUGGER and you will it by yourself. If you are talking of ASP.NET, you can use Page property IsPostback in order to avoid the rebind on postback.

Once this is done, you can get the value selected using SelectedIndex/SelectedValue or so depending on the control you are using. Just do a quickwatch on the dropdown and one of the properties shoould hold the selected value.

Try!


这篇关于如何在ASP中获取选择标记的选择值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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