I have a number of pages that all reference a certain master page. In the Page_Load of one of them, I have the following code:
Code: Dim PageBody As HtmlGenericControl = Me.Master.Body
If Not PageBody Is Nothing Then PageBody.Attributes.Add("onload", "scrollToPageBottom()")
This works fine as long as I stay on that page. I have several buttons on the page that do various things and then Redirect.Response to this page, and the scrolling works fine.
However, if I click a link on this page that goes to another page that is based on the same master page, my body tag still has the onload attribute set, and so it scrolls to the bottom of the page too, which is not what I want.
How do I detect that the first page mentioned above is being unloaded so that I can remove the onload attribute from the body tag? Or is there another way that I should be accomplishing this?
Thanks!