locked
What am I doing wrong? RRS feed

  • Question

  • I'm trying to make it so that when the user clicks on button1 it causes the URL that the hyperlink (hyper, I named it)links to to change to whatever is in TextBox1.Text.  So far I've got this:

     

    1    Dim TextBoxInput As String = TextBox1.Text
    2            hyper.NavigateUri = TextBoxInput
    

     

    and

    1    Dim TextBoxInput As String = TextBox1.Text
    2            hyper.NavigateUri(TextBoxInput)
    

     

    But they give me the error:

    Value of type 'String' can not be converted to 'System.Uri'.

     

    What am i doing wrong?  Please help and be patient, I'm new to this.

    Sunday, February 14, 2010 10:24 PM

Answers

  •  Try something like this:


       hyper.NavigateUri(new Uri(TextBox1.Text))
      
    Sunday, February 14, 2010 10:49 PM

All replies

  •  Try something like this:


       hyper.NavigateUri(new Uri(TextBox1.Text))
      
    Sunday, February 14, 2010 10:49 PM
  • I messed around withit for a sec, and got this:

    1    hyper.NavigateUri = new Uri(TextBox1.Text)
    

     

    Which worked Perfectly.  THANK YOU!

    Sunday, February 14, 2010 10:59 PM