在单击按钮后的webpart中,应显示文本框和标签 [英] in a webpart after the button is clicked the textbox and label should be displayed

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

问题描述

在单击按钮后的webpart中,应显示文本框和标签

in a webpart after the button is clicked the textbox and label should be displayed

推荐答案

protected void Button1_Click(Object sender,Eventargs e)
{
     label1.visible = true; // set property as visible false prior
     textbox1.visible = true; //set property as visible false prior
}







或者你可以动态地做它




or you can do it dynamically

protected void Button1_Click(Object sender,Eventargs e)
{
    Label lable1 = new Label();
    TextBox textbox1 = new TextBox();
    
    //you will need to have a container( placeholder or panel) control where you want to add them
   contarinerControl.Add(label1);
   contarinerControl.Add(textbox1);

 
}


这篇关于在单击按钮后的webpart中,应显示文本框和标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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