Hi ,

I have text box and beside to it I have a linkbutton showing the link that is present in the text box. I am getting the URL from the website into the text from database.I need to open the link button in a new browser window.


aspx page

<asp:Label ID="lblBusinessURL" runat="server" Text="Label"></asp:Label>
                                                               
 <asp:LinkButton ID="lnkBusinessURL"  runat="server" ></asp:LinkButton>

aspx.cs page

string businessurl;
            businessurl = DSabc.Tables[0].Rows[0]["BusinessURL"].ToString();
            if (businessurl.Contains ("http://"))
            {
                 lblBusinessURL.Text = "<a href=" + businessurl  + ">" + businessurl + "</a>";
            }
            else {
             lblBusinessURL.Text = "<a href=http://" + businessurl  + ">" + businessurl  + "</a>";
            
            }

Can anybody help??

Thanks in Advance.

Use HyperLink instead of LinkButton.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.