Back Button

  • Thread starter Thread starter pmelanso
  • Start date Start date
P

pmelanso

Hello,
I have create a back button on my page and was wondering if there is
away to display a different image (a disabled version) when there isn't
a back page... how would i go about doing this???

Pamela
 
i guess your question how to determine if there is history exists

From code behind c#,

if (Request.UrlReferrer != null)
{
if(Request.UrlReferrer == Request.Url)
btnBackImg.Enabled = false;
}
else
btnBackImg.Enabled = false;

I think, There is no way to check this using javascript .. the closest is a
check like

if(window.history.length > 0) ..

but window.history.length will be greater than 0 if a back page or forward
page exists...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top