在选择单选按钮时显示文本框 [英] show textbox on selecting radio button

查看:108
本文介绍了在选择单选按钮时显示文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显示有关选择单选按钮的文本框

show textbox on selecting radio button

推荐答案

好的,继续执行它.

在这里不能这样工作.

这是询问者的期望:
1. 先尝试您要做什么!您可能会发现它并不难.
2.制定看起来像问题/无法解决的问题.

试试看,告诉他们是否遇到问题.
成员将很乐意为您提供帮助.



现在,从这里开始阅读,看看如何使用OnCheckedChanged event:
如何在RadioButton中使用OnCheckedChanged事件 [ ^ ]
MSDN:RadioButton类 [
Good go ahead and implement it.

It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it''s not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.



For now, Start reading from here and see how OnCheckedChanged event can be used:
How to use OnCheckedChanged event in RadioButton [^]
MSDN: RadioButton Class[^]


您好,我亲爱的朋友使用此功能,将对您有所帮助.

设计页面aspx
================

Hello My dear Friend use this, it will be helpful.

Design Page aspx
================

<asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="true"

            oncheckedchanged="RadioButton1_CheckedChanged"/>

        <asp:TextBox ID="TextBox1" runat="server" Visible="false" ></asp:TextBox>




代码页cs
===========





Code Page cs
============


using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class RadioButton_Textbox : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
    {

        if(RadioButton1.Checked)
        {
            TextBox1.Visible = true;
        }
        else
        {
            TextBox1.Visible = false;

        }
    }
}




再见.............




BYE.............


这篇关于在选择单选按钮时显示文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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