Forums » .NET » .NET »

PostbackURL


Posted Date: 27 Nov 2008      Posted By:: Preet     Member Level: Gold    Member Rank: 78     Points: 1   Responses: 6



Can anyone please explain what is PostBackUrl and why it is used?

Thanks and Regards




Responses

#322435    Author: Arun Jacob      Member Level: Gold      Member Rank: 494     Date: 27/Nov/2008   Rating: 2 out of 52 out of 5     Points: 2

PostBackUrl is used to set the url to which the page should go during the post back.so after post back that url will load in the browser.

:-)

Arun Jacob


 
#322436    Author: narenderraobalguri      Member Level: Silver      Member Rank: 0     Date: 27/Nov/2008   Rating: 2 out of 52 out of 5     Points: 3

Postbackurl is a simple way to transfer the control to required page
by using this property u can transfer the control to required page with out writing any code in onclick event.


 
#322720    Author: gowthami chowdary      Member Level: Gold      Member Rank: 0     Date: 28/Nov/2008   Rating: 2 out of 52 out of 5     Points: 6

ASP.NET Web Forms extensively use postback mechanism in order to maintain the state of the server-side controls on the web page. This makes it somewhat tricky to perform URL rewriting for ASP.NET pages. When a server side form control is added to the web page, ASP.NET will render the response with HTML <form> tag that contains an action attribute pointing back to the page where the form control is. This means that if URL rewriting was used for that page, the action attribute will point back to the rewritten URL, not to the URL that was requested from the browser. This will cause the browser to show rewritten URL any time a postback occurs.

The PostBackUrl property is used to gets or sets the URL of the page to post when the Button control is clicked.
syntax:

<asp:Button PostBackUrl="string" runat="server" />

ex:

<form runat="server">
Name:<asp:textbox id="TextBox1" runat=Server />
<asp:button id="Button1" Text="Submit"
PostBackUrl="demo_postbackurl.aspx" runat="Server" />
</form>





 
#322938    Author: Lalit Vasant Patil      Member Level: Silver      Member Rank: 1539     Date: 28/Nov/2008   Rating: 2 out of 52 out of 5     Points: 4

Hi,

For better understanding.

1.http://www.dotnetheaven.com/UploadFile/prathore/PostBack05032007005048AM/PostBack.aspx

2.http://msdn.microsoft.com/en-us/library/ms178140.aspx

3.http://www.w3schools.com/aspnet/prop_webcontrol_button_postbackurl.asp

-Happy Codding(-_-)


 
#323222    Author: Fool To Code      Member Level: Gold      Member Rank: 229     Date: 29/Nov/2008   Rating: 2 out of 52 out of 5     Points: 3

if you want to redirect your page to google.com on button's click then

on button's click event:

button1.PostBackUrl="http://www.google.com"

and google will be opened on your page


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Return to Discussion Forum
Start new thread

Subscribe to Subscribers
Awards & Gifts
Talk to Webmaster Tony John

Online Members

Phagu Mahato
More...
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India