在asp.net中启用和禁用方法? [英] enable and disable method in asp.net?

查看:137
本文介绍了在asp.net中启用和禁用方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有html页面< input type =text>当我加载此页面时,它将禁用这意味着数据无法编辑,并且编辑按钮单击时间所有数据显示启用edit..how它设置?

解决方案

试试这个



  protected   void  Page_Load(发件人对象,EventArgs e)
{
If(!Page.IsPostBack)
{
textBox1.Enabled = False;
// textBox1.ReadOnly = True; //可选
}

}
受保护 void BtnEdit_Click(发件人 object ,EventArgs e)
{
textBox1.Enabled = True;
// textBox1.ReadOnly = False; //可选

}





请阅读 this文章 for jquery function


嗨...

 


(文件)。就绪(函数(){

i have html page <input type="text"> containg in this page when i load this page it will disable that mean the data couldnot be editable and the edit button click time the all data show enable edit..how it set?

解决方案

try this

protected void Page_Load(Sender object,EventArgs e)
{
 If(!Page.IsPostBack)
   {
    textBox1.Enabled=False;
    //textBox1.ReadOnly=True;//optional
   }

}
protected void BtnEdit_Click(Sender object,EventArgs e)
{
 textBox1.Enabled=True;
 //textBox1.ReadOnly=False;//optional 

}



please read this article for jquery function


Hi...


(document).ready(function(){


这篇关于在asp.net中启用和禁用方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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