HyperLink Control Question

Posted on 2005-04-27
Last Modified: 2010-04-07
How can I dynamically change the "NavigateURL" property of the HyperLink control?

I'm using the built-in html "" functionality.
This forces the user's default email client to handle the message with a pre-loaded addressee.
So, obviously you can see why I would want to change the addressee (NavigateURL property) on the fly with this control.

No javascript, please.

Thanks in advance.
Question by:born4code
    LVL 18

    Expert Comment

    you can access NavigateURL property in your code behind...

    HyperLink1.NavigateURL = "mailto:" + ""

    LVL 8

    Accepted Solution

    protected System.Web.UI.WebControls.HyperLink myLink;
    myLink.NavigateURL = "";

    OR if that doesn't work, then you may need to use a plain old Html control

    protected System.Web.UI.HtmlControls.HtmlAnchor myLink;
    myLink.Attributes["href"] = "";

    I'm not entirely sure whether a HyperLink control can do a mailto. But one of these two solutions should do what you need.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now