控制可见性,无需后包装 [英] Control Visibility without postpack

查看:59
本文介绍了控制可见性,无需后包装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,...
我想在用户标记复选框时使文本框可见
我这样做并在按钮中编写了代码.但是在postpack之后会出现

我想在没有后包装的情况下做到这一点

谁能告诉我该怎么做?

Hello ,...
i want to make a textbox visible when the user mark on check box
i did this and write a code in the button .but it is apear after postpack

i want to do this without postpack

can anyone tell me how can i do that

推荐答案

如果要避免回发,则将显示属性设置为none的文本框(请注意,可见false不起作用,则必须从后面的代码中将显示样式设置为无.然后在客户端编写一个javascript函数以显示/隐藏该文本框,并使用它的客户端ID并将该函数附加到复选框中.
If you want to avoid postback, then have a textbox with display property as none ( Keep in mind that visible false would not work, you have to style display as none from code behind). Then write a javascript function at Client side to display/hide the textbox, using it''s client id and attach the function with checkbox.


我想不使用后包装
您可以使用 Javascript 来实现.

将客户端的onclick处理程序附加到该复选框,并将Javascript方法绑定到该复选框.因此,单击该复选框,将引发此Javascript方法,并且您可以根据需要设置文本框的可见性(使用显示样式进行隐藏/显示).

尝试!
i want to do this without postpack
You can do it using Javascript.

Attach a client-side onclick handler to the checkbox and tie a Javascript method to it. Thus, on click of the checkbox, this Javascript method would be raised and you can set the visibility(use display style for hiding/showing) of the textbox as per your need.

Try!


您可以尝试应用可以解决您的回发问题的Ajax更新面板
问题.
Your can try apply ajax update panel that can solved your postback
problem.


这篇关于控制可见性,无需后包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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