Working with Cross page post back in asp.net 2.0
Hi 

In Asp.Net, By default the button control posts back to the same page that contain the button. In most of the cases this behavior is ok. But sometime we want to be able to post to another page in the application. In Asp.Net 1.X we used the Server.Transfer method to move between the pages without changing the URL. 

But in Asp.Net 2.0 we can post to a different page, firing a normal post back to a different page inside the application. We can also access the values of the server control of the source page that initiated the post back.

Cross page post back can be used by control that implements IButton Interface (Button, Link Button, and Image Button). We need to set the PostBackUrl property to specify the target post back page on the click event.

To access the previous page property in the target page we use the PreviousPage property. By default the previousPage property is of page type hence we need to access the control using the FindControl method. You can also enable strongly-typed access to the source page by setting the @PreviousPageType directive in the target page to the virtual path or Type name of the source page. If you intend for multiple pages to post to a single target page, you cannot use the strongly-typed directive.

Hope this helps
Thanks
Vikram


Share this post   Email it |  digg it! |  reddit! |  bookmark it!

Feedback

Posted on 12/18/2006 5:52:08 AM

Nice website.. But i couldn't add ur atom/rss to my rssreader.. it says, old version like that

Posted on 12/18/2006 8:28:12 PM

HI

Thanks for the complement. I have not had any problem in adding the rss or atom as yet. Which RSS Reader are you using

Please post your comments:

Name:  
Email (optional): Your email address will not be posted.
URL (optional):
Comments: HTML will be ignored, URLs will be converted to hyperlinks  
Enter the text you see in the box:
 
Copyright © 2006 - 2009 Vikram Lakhotia