Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 337
  • Last Modified:

Dynamically set the navigateurl property

Hi there

I have a hyperlink control on a webform. The text for that hyperlink comes as a string from the database and that keeps changing dynamically.

say I am getting a static www.xyz.com from the database.. I can use the following code
hyperlink1.navigateurl="http://www.xyz.com"
hyperlink1.target="_new"
 but my problem is I want to make the navigateurl property to accept changes dynamically(be able to take the parameter the database suppllies)during runtime.

can anyone please help?
0
hardlearner
Asked:
hardlearner
1 Solution
 
hardlearnerAuthor Commented:
Hello guys

i found an answer myself

just follow the code:


Me.Hyperlink1.Text =dataset .Tables(0).Rows(0).Item("website")
 If Len(Hyperlink1.Text.Trim()) > 0 Then
                Dim s As String = "http://"
                Hyperlink1.NavigateUrl = s & dataset .Tables(0).Rows(0).Item("website")
                Hyperlink1.Target = "_new"
                Hyperlink1.ToolTip = "Click the link to visit this Website"
            Else : Hyperlink1.Visible = False

            End If
0
 
moduloCommented:
PAQed with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now