Http://tnt2.cn/blog/article.asp? Id = 108
The first is postbackurl. controls such as button and linkbutton all have this attribute. See the following example:
Demo. aspx
Program Code <Asp: hiddenfield id = "hidden_id" runat = "server" value = "test"/>
<Asp: linkbutton id = "linkbutton1" runat = "server" postbackurl = "test. aspx"> linkbutton </ASP: linkbutton>
<Asp: button id = "button1" runat = "server" text = "button" postbackurl = "test. aspx"/>
Test. aspx. CS
Program Code protected void page_load (Object sender, eventargs E)
{
If (previouspage! = NULL)
{
Hiddenfield hidden_id = (hiddenfield) previouspage. findcontrol ("hidden_id ");
If (hidden_id! = NULL)
{
Label1.text = hidden_id.value;
}
}
Else
{
Label1.text = "null ";
}
}
Server. transfer is a server-based method, while postbackurl is client-based. In this sense, cross-page transfer is more convenient than server. Transfer, which improves server performance and reduces processing steps. Apart from this, the two are very similar, but in ASP. NET 2.0, cross-page transfer is obviously a better choice.
If you want to determine whether the page referenced by perviouspage is submitted across pages or transmitted using the server. transfer method, you can determine through the iscrosspagepostback attribute.
Program code if (previouspage! = NULL)
{
If (previouspage. iscrosspagepostback = true)
{
Response. Write ("cross-page post .");
}
}
Else
{
Response. Write ("not a cross-page post .");
}