For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > May 2004 > HTML anchor ServerClick









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HTML anchor ServerClick
Jon Cosby

2004-05-30, 8:39 pm

I'm trying to find a simple script for hiding my email until the user
chooses to
send a message. I thought I might be able to do this with the ServerClick
event on
the HTML anchor, setting the valid url there. What happens is that some
JavaScript
code is added, and the url is replaced by call to a "__doPostBack"
function:
href="javascript:__doPostBack('MailBtn','')". All that happens when the link
is clicked
is a reload. What is this function? Somebody know a better way to do this (I
really
don't want to use a cumbersome form).

<script runat="server">
void EmailAnchor_Click(Object sender, EventArgs e)
{
MailLink.HRef = "mailto:myemail@mindspring.com";
}
</script>

<a id="MailLink" href="mailto:me@nospam.net"
OnServerClick="EmailAnchor_Click" runat="server">




Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com