具有autopostback的下拉列表,因为提交后无法正常工作 [英] Dropdownlist with autopostback as false not working after submit

查看:52
本文介绍了具有autopostback的下拉列表,因为提交后无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小表格和更新面板。在表单上我有一些jquery,当选择一个选定的索引时,它会显示一些额外的输入。然后我提交输入。提交后我的Jquery不起作用?我可以移动服务器的可见性,但我更喜欢用JS做这个。



所以我的问题是如何让我的JS在提交后再次运行在更新面板中刷新表格?



我尝试过的方法:



如果不是Page.IsPostBack那么



如果不是Page.IsPostBack然后



初始()



LoadData()



else

''让ddl得到它的datsource再次





结束如果





i已将jquery从/ hide改为
到css(display,none)

i have a small form inside and update panel. On the form I have some jquery that will make display some additional inputs when the a selected index is chosen. I then submit the input. After the submit my Jquery does not work? I can move the visibility of the server, but i would prefer to do this with JS.

So my question is how do I get my JS running again after a submit to a refreshed form within an update panel?

What I have tried:

If Not Page.IsPostBack Then

If Not Page.IsPostBack Then

Initpage()

LoadData()

else
'' made the ddl get its datsource again


End If


i have changed the jquery
from hide() to css("display","none")

推荐答案

使用ScriptManager和在pageLoad中运行你的jquery代码而不是
Use ScriptManager and run your jquery code in pageLoad rather than


(document).ready



如何在updatepanel执行完成后运行javascript | ASP.NET论坛 [ ^ ]



如果你不能从上面开始工作那么你需要更新你的问题包括相关代码和标记。
(document).ready

How to run javascript after updatepanel execution completed | The ASP.NET Forums[^]

If you can't get it working from the above then you'll need to update your question to include the relevant code and markup.


这篇关于具有autopostback的下拉列表,因为提交后无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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