0

I am using asp.net and i have a hyperlink tag like this:

<asp:HyperLink ID="BusinessWebSiteHyperLink" runat="server" Text="Hyperlink"></asp:HyperLink>

I am adding the address from code behind like this:

  DataTable dt = objYPSearchResultsDataAccess.GetYPBusinessListingDetails(businessID);
  BusinessWebSiteHyperLink.Text = dt.Rows[0]["BusinessWebsite"].ToString();
  string Hyperlink = dt.Rows[0]["Hyperlink"].ToString();
  if (Hyperlink == "True")
  {
     BusinessWebSiteHyperLink.NavigateUrl = BusinessWebSiteHyperLink.Text;
  }
 else
  {
     BusinessWebSiteHyperLink.NavigateUrl = "";
  }

every thing is fine but when i click the Business url in the page then the page should redirect me to the business website but it is adding localhost/7467567/...../www.stakeoverflow.com. i just want to redirect my page to stakeoverflow when it is clicked. how to solve this?

4
  • what's a typical value in BusinessWebSiteHyperLink.Text ? Commented Sep 28, 2013 at 9:36
  • for eg. www.stakeoverflow.com it can have Commented Sep 28, 2013 at 9:38
  • should that be www.stackoverflow.com, or is this a Beef Eater place? Commented Sep 28, 2013 at 9:40
  • that should be www.stakeoverflow.com Commented Sep 28, 2013 at 9:58

1 Answer 1

1

Try adding HTTP to the front of the url..

"http://" + BusinessWebSiteHyperLink.Text

Here is my test...

enter image description here enter image description here

when I hover over test url, I get...

enter image description here

When I hover over test No HTTP, I get...

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

I have just tested the code, and it works fine...can you post your updated code where you append http://

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.