Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 7 of 7

Thread: Create linkbutton to activate hyperlink in C#.net

  1. #1

    Create linkbutton to activate hyperlink in C#.net

    I want to create a linkButton to activate my hyperlink which will open a new page in a new window. I would like to know how to code the codes for activate the hyperlink which I wish to place it in the 'onclick' event of the linkButton.
    Thanks!...
    Last edited by fishjelly; September 4th, 2008 at 03:59 AM.

  2. #2
    Hi fishjelly!
    For WPF, the code is Process.Start("http://www.foo.com"). For Silverlight, the code is HtmlPage.Window.Navigate(new Uri("http://www.foo.com"));

    Cheers!
    Kirupa

    Great, now even Kirupa is { facebooking | twittering }

  3. #3
    Quote Originally Posted by kirupa View Post
    Hi fishjelly!
    For WPF, the code is Process.Start("http://www.foo.com"). For Silverlight, the code is HtmlPage.Window.Navigate(new Uri("http://www.foo.com"));

    Cheers!
    Kirupa

    Hi Kirupa!
    What if I am using Visual Studio 2005?

    Thanks!
    fishjelly

  4. #4
    It should still work provided it is at least a C# 2.0 project. What error are you getting?

    Great, now even Kirupa is { facebooking | twittering }

  5. #5
    Quote Originally Posted by kirupa View Post
    It should still work provided it is at least a C# 2.0 project. What error are you getting?
    Hmm...The error is:
    The name 'Process' does not exist in the current context

    This is my codes.I have a textBox to retrieve the user key in url path.
    Is there any codes to trigger the hyperlink?

    protected void LinkButton1_Click(object sender, EventArgs e)
    {

    testHyperLink.NavigateUrl = urlTextBox.Text;

    // code to tigger the hyperlink

    }

    Thanks!

  6. #6
    Just add a Reference (http://www.kirupa.com/blend_silverli...ctives_pg1.htm)

    Right click on Process, and click on the Resolve button to choose the namespace to fix it

    Great, now even Kirupa is { facebooking | twittering }

  7. #7
    Quote Originally Posted by kirupa View Post
    Just add a Reference (http://www.kirupa.com/blend_silverli...ctives_pg1.htm)

    Right click on Process, and click on the Resolve button to choose the namespace to fix it

    Hi Kirupa!
    Thanks!!!...I solve the problem already...really thanks a lot...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012