RegisterClientScriptBlock

Last post 05-13-2008 4:13 AM by Yaler. 2 replies.

Sort Posts:

  • RegisterClientScriptBlock

    05-12-2008, 2:00 PM
    • Member
      27 point Member
    • Yaler
    • Member since 06-26-2006, 12:09 PM
    • Spain
    • Posts 25

    In my code i use this instruccion 'RegisterClientScriptBlock' for register javascript code and excute it in a postback, but when i go back in explorer's history the registered javascript code before is executed again.

    How can i remove this code, and prevent it from executing again?

    Thanks

  • Re: RegisterClientScriptBlock

    05-12-2008, 7:13 PM
    Answer
    • Participant
      1,037 point Participant
    • bubblesnout
    • Member since 08-08-2007, 10:54 PM
    • Posts 238

    When you go back in your browser, you are going to be 're-loading' all of the data and markup that was rendered in that previous visit to the page. So if it contained a script (due to using RegisterClientScrptBlock), then its going to use it again. No real way to change it, as it's just how the browser works.

    Best way around it is to create your own back button on your pages. Just make it a link (or a button) that when clicked, will navigate to the page which was previous to the current one.

  • Re: RegisterClientScriptBlock

    05-13-2008, 4:13 AM
    • Member
      27 point Member
    • Yaler
    • Member since 06-26-2006, 12:09 PM
    • Spain
    • Posts 25

    Thanks, I was imagining it

Page 1 of 1 (3 items)