Dynamically set the navigateurl property

Posted on 2005-05-03
Last Modified: 2008-02-01
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 from the database.. I can use the following code
 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?
Question by:hardlearner

    Author Comment

    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

    Accepted Solution

    PAQed with points refunded (125)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    794 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

    17 Experts available now in Live!

    Get 1:1 Help Now