The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


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