Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have some html code:

<font color="#0D4985">Click </font> <a href="javascript:hideMe();">

 

that I need to convert to asp.net

 

I will need to

javascript:hideMe();

 

when the asp.net page loads. (well.. It can stay open if a login attempt just failed)

 

any ideas?

 

thanks

Lee

Posted

It's kind of vague what you're trying to do but...

 

You could make the link a LinkButton instead of a html anchor (it will display the same), and then on your post back if the login fails do nothing, but if it's successful hide the button by setting it's visiblility to false...but then most login pages go to a differant screen after successful login attempts so I don't know why you would stay on the same page.

 

If your trying to hide the button so they can't click it more than once you can add the following the button's on load event:

 

if(btnOk.Attributes("onclick")==null)

{

btnOk.Attribute("onclick") = "javascript:hideMe();"

}

 

And then do the same code as I mentioned above to hide the button if necessary.

 

Also you should use

 

<span style="color: #0D4985;">Click</span><a href="javascript:hideMe():">

 

instead of the font tag...it's deprecated I believe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...