!IsPostBack,TextMode,readonly和disabled,PostBackUrl(! Ispostback, textmode, readonly and disabled, postbackurl)

!IsPostBack(回调函数)IsPostBack 是指页面的状态是否是Post回发的状态,前面加逻辑非“!”符号,表示页面不是Post回发的状态下,也就是指页面初始的状态。

IsPostBack 是 asp.net 框架Page类中一个bool类型的属性,用来判断针对当前页面Form的请求是第一次还是非第一次请求:



TextModea、TextMode 属性用于设置或返回 TextBox 控件的行为模式。

b、语法:<asp:TextBox TextMode=”mode” runat=”server” />

c、TextBoxMode 枚举值之一。默认值为 SingleLine。

d、可能的值:SingleLine – 默认。表示单行输入模式。MultiLine – 表示多行输入模式。Password – 表示密码输入模式。









PostBackUrl 属性用于获取或设置当 LinkButton 控件被点击时要回传的目标页面的 URL。

<asp:Button ID=”Button2″ runat=”server” Text=”取消” PostBackUrl=”~/Classinfo.aspx” CausesValidation=”false” />


! Ispostback (callback function) ispostback refers to whether the state of the page is post postback, preceded by a logical non “!” symbol, indicating that the page is not post postback, that is, the initial state of the page.

Ispostback is a bool type attribute in the page class of the asp.net framework, which is used to determine whether the request for the form of the current page is the first or not:

1. When ispostback = true, it means that it is not the first request, which is called postback;

2. When ispostback = false, it indicates the first request.

The textmodea, textmode properties are used to set or return the behavior mode of the TextBox control.

b、语法:<asp:TextBox TextMode=”mode” runat=”server” />

c. One of the textboxmode enumeration values. The default value is singleline.

d. Possible values: singleline – default. Represents a single line input mode. Multiline – indicates multiline input mode. Password – indicates the password entry mode.

The difference between read only and disable

The difference between the readonly and disabled attributes of the tag:

In form elements, readonly and disable are similar because they can set some form elements to “unavailable” status. Of course, the differences between them are huge. Here are the differences between these two attributes, hoping to bring some help to friends in need.

The differences between the two attributes are listed:

1. The readonly attribute is only valid for the text box, password box and multi line text box of the form element, while the disabled attribute is valid for all form elements.

2. The appearance of the two properties is different. You can observe this for yourself.

3. The value value of the form element set to readonly will still be submitted, while the value of the form element set to disabled will not be submitted.


The postbackurl property is used to get or set the URL of the target page to be returned when the LinkButton control is clicked.

<asp:Button ID=”Button2″ runat=”server” Text=”取消” PostBackUrl=”~/Classinfo.aspx” CausesValidation=”false” />