本文介绍了当文本框属性为true时,如何获取文本框值.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

这是kranti kumar.

我正在作为Web开发人员.我的问题是我创建了一个文本框并将只读属性设置为true,但是回发后该值消失了.
页面发回后如何管理文本框的值.



谢谢.

hello !

This is kranti kumar.

I am working as web developer. My problem is I created one text box and set read only property as true, but after post back the value disappears.
How can I manage the value of the text box after the page post back.



Thank you.

推荐答案

if (!IsPostBack)
  {

  }



您可以在其中编写代码.



You can write the code inside this. It does not affect on postbacks.


protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        TextBox1.Text = "set Text on Page load Test";
    }

}



这篇关于当文本框属性为true时,如何获取文本框值.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 15:19
查看更多