Page Auto Postback Property
E.g.: -if(Page.IsPostBack==True)
{
// Do processing
}
OR
if(!Page.IsPostBack)
{
// Do Processing
<script
runat="server">
Sub Change(obj As
Object, e As EventArgs)
Response.Write("You selected "
& rb1.SelectedItem.Text)
End Sub
</script>
<form runat=server>
<asp:RadioButtonList
id="rb1" AutoPostBack="True"
runat="server"
OnSelectedIndexChanged="Change">
<asp:ListItem Text="Item 1"
/>
<asp:ListItem Text="Item 2"
/>
</asp:RadioButtonList>
</form>
ASP.NET generates the _doPostBack() function
automatically, provided at least one control on the page uses automatic post
backs. Any Control that has its AutoPostBack Property set to true is connected
to the _doPostBack() function using the onclick or onchange attributes. These
attributes indicate what action should Browser take in response to the
Client-Side javascript events onclick and onchange. In other words, ASP.Net
automatically changes a client-side javascript event into a server-side ASP.Net
event, using the _doPostBack() function as an intermediary.
0 comments
Post a Comment