Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Back Button - Javascript

jojupi01jojupi01 Member Posts: 12
Hi,

I have an aspx page. I want to place a back button which on click loads the previous page. I tried doing it in 2 ways.

1)I placed a server control in the page and the code is as follows It gives me the following error :
" CS1026: ) expected" .

2)So i try the second method just using a html input button which works fine but i have a problem even if i set visible = false i can still see the button and i cant access this control from the code behind page(.cs) so that i can control it based on certain condition.

How do i go abput.Any help appreciated.

Regards,

Jo

Comments

  • iwilld0itiwilld0it Member Posts: 1,134
    THe ASP.NET button control will not let you use the onclick ...

    try onmouseup event ...

    [code]

    [/code]

    If it dont work this way, then add it programtically ...

    [code]
    btn.Attributes("onmouseup") = "history.go(-1);"
    [/code]

    : Hi,
    :
    : I have an aspx page. I want to place a back button which on click loads the previous page. I tried doing it in 2 ways.
    :
    : 1)I placed a server control in the page and the code is as follows It gives me the following error :
    : " CS1026: ) expected" .
    :
    : 2)So i try the second method just using a html input button which works fine but i have a problem even if i set visible = false i can still see the button and i cant access this control from the code behind page(.cs) so that i can control it based on certain condition.
    :
    : How do i go abput.Any help appreciated.
    :
    : Regards,
    :
    : Jo
    :

  • singhrohit82singhrohit82 Member Posts: 33
    Hi,

    You can use
    document.getElementById("btn").style.visibility="hidden";
    to hide the button.
Sign In or Register to comment.