Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > UpdatePanels, LinkButtons, and PostBackUrls

Reply
Thread Tools

UpdatePanels, LinkButtons, and PostBackUrls

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      09-11-2008
I have an UpdatePanel that contains a LinkButton with a PostBackUrl. The
LinkButton is marked as a PostBackTrigger, so it does a full postback.
However, when it posts back, it goes straight to the page specified in the
PostBackUrl. I always thought (and the way I have always used it in the
past, where it worked) that it posted back to the page the button is on,
executed the stuff like Page_Load and the eventhandler for the button's
Click event, created the PreviousPage property, and then went to the page
specified in PostBackUrl. When using PostBackUrl, is it supposed to execute
the current page before going to the one specified in the PostBackUrl
property? Thanks.

Nathan Sokalski
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Erjan Gavalji
Guest
Posts: n/a
 
      09-11-2008
Hi Nathan,

You might be confusing the PostBackUrl functionality with the
Server.Transfer or Response.Redirect call. The PostBackUrl functionality
actually sets the action property of the form to the specified URL, so the
browser makes the post request towards it.

To have some of the source page life cycle steps executed first, you can use
a normal postback and then either use Response.Redirect, or Server.Transfer.
You could prefer Server.Transfer if you need to access the post data from
the target page.

Cheers,
Erjan

"Nathan Sokalski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have an UpdatePanel that contains a LinkButton with a PostBackUrl. The
>LinkButton is marked as a PostBackTrigger, so it does a full postback.
>However, when it posts back, it goes straight to the page specified in the
>PostBackUrl. I always thought (and the way I have always used it in the
>past, where it worked) that it posted back to the page the button is on,
>executed the stuff like Page_Load and the eventhandler for the button's
>Click event, created the PreviousPage property, and then went to the page
>specified in PostBackUrl. When using PostBackUrl, is it supposed to execute
>the current page before going to the one specified in the PostBackUrl
>property? Thanks.
>
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/
>


 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      09-11-2008
That is probably true, but something I found on the web after making my
original post was that the events from the source page I mentioned
(Page_Load, Click, etc.) are executed only if the PreviousPage property is
accessed on the target page. The author of the page I got was not sure why
this was the situation, but when I added a statement to my target page that
used the PreviousPage property, these events were executed, so I guess it
does work this way. I'm sure there is a little more detail to it somewhere,
but for now, this lets me do what I want.

Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/

"Erjan Gavalji" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Nathan,
>
> You might be confusing the PostBackUrl functionality with the
> Server.Transfer or Response.Redirect call. The PostBackUrl functionality
> actually sets the action property of the form to the specified URL, so the
> browser makes the post request towards it.
>
> To have some of the source page life cycle steps executed first, you can
> use a normal postback and then either use Response.Redirect, or
> Server.Transfer. You could prefer Server.Transfer if you need to access
> the post data from the target page.
>
> Cheers,
> Erjan
>
> "Nathan Sokalski" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I have an UpdatePanel that contains a LinkButton with a PostBackUrl. The
>>LinkButton is marked as a PostBackTrigger, so it does a full postback.
>>However, when it posts back, it goes straight to the page specified in the
>>PostBackUrl. I always thought (and the way I have always used it in the
>>past, where it worked) that it posted back to the page the button is on,
>>executed the stuff like Page_Load and the eventhandler for the button's
>>Click event, created the PreviousPage property, and then went to the page
>>specified in PostBackUrl. When using PostBackUrl, is it supposed to
>>execute the current page before going to the one specified in the
>>PostBackUrl property? Thanks.
>>
>> Nathan Sokalski
>> (E-Mail Removed)
>> http://www.nathansokalski.com/
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UpdatePanels, LinkButtons, and PostBackUrls Nathan Sokalski ASP .Net Web Controls 2 09-11-2008 08:52 PM
if and and vs if and,and titi VHDL 4 03-11-2007 05:23 AM



Advertisments