我需要ASP.Net中的代码才能单击单选按钮.. [英] I need Code in ASP.Net for clicking radio button ..

查看:89
本文介绍了我需要ASP.Net中的代码才能单击单选按钮..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们选择特定的单选按钮选项,则它应该在同一Web表单中显示一些额外的功能,例如,在填写表单时将以这种格式显示.
课程B.tech -单选按钮(是,否)

如果单击是",它应该询问有关B.tech的详细信息,例如百分比和其他内容,当然,否则B.tech应当隐藏.

如果单击否",则我不应该以相同的形式询问这些详细信息并继续进行详细说明.

If we select particular radio button option it should display some extra features in the same web form for example while fill the form there will be in this format.
course B.tech - radiobuttons(yes, No)

If I click yes it should ask about B.tech details like percentage and other things in down of course B.tech other wise I should be hide.

If we click No i should not ask those details and proceeding for further details in the same form.

推荐答案

您可以按照演示的
You can handle the click within JavaScript as demonstrated here[^].



您可以在面板中放置其他详细信息,并且面板开始时的可见性设置为false.
将单选按钮的autopostback设置为true并编写以下代码:


Hi,
You can place extra details inside a panel and the panel visibility set to false at the beginning.
Set the autopostback of radio button to true and write the following code:


protected void rbYes_CheckedChanged(object sender, EventArgs e)
   {

if(rbYes.Checked)
{
Panel1.Visible=true;
}
else
{
panel1.Visible=False;
}
}


您好,JavaScript很简单,请使用以下代码获得所需的内容.我认为很简单,您需要隐藏并显示将要显示的特定面板.管理单选按钮的点击.

Hi Javascript made it simple please use the following code you will get what you are looking for.I think simple you need to hide and show the particular panel which will be manage on radio button click.

function ShowHide(chk)
{
var chkId=  document.getelementbyId(chk);
if(chk.checked==true)
{
  document.getelementById("tempPanel").style.display="";
}
else
{
  document.getelementById("tempPanel").style.display="none";
// comment clear all the filled data as soon as panel goes hide.

}

   
}


注意:-在单选按钮的单击上调用上述功能


NOTE :- call the above function onclick of radio button


这篇关于我需要ASP.Net中的代码才能单击单选按钮..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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