Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5960899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:53:23+00:00 2026-05-22T18:53:23+00:00

I have a control on one of my page which takes some user input

  • 0

I have a control on one of my page which takes some user input (URL) and allows the user to test the link.

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("URL") %>' Target="_blank">Click here to test link</asp:HyperLink>

The problem is if the user puts in the URL “google.com”, then the link will be treated as “http://localhost/google.com&#8221;. I have to put “http://www.google.com&#8221; for it to go to the right place.

Is it possible to treat the link like it is an absolute link in all cases?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:53:24+00:00Added an answer on May 22, 2026 at 6:53 pm

    Try this…

    NavigateUrl='<%# Eval("URL", "http://{0}") %>'
    

    Edit: if you want to add check whether it already contain http:// then it should be like..

    NavigateUrl=<%# Eval("URL").ToString().Contains("http://") == true ? Eval("URL") :
     "http://" + Eval("URL")  %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking to control videos on my page, some of which may have not
i have one user control and one aspx page. with the help of jquery
I have two cascading dropdowns and one gridview control. on page load iam binding
How can one have more than a Wizard control on the same page without
I have a jQueryUI Tabs control on a web page. Each tab contains one
I have a scenario where i have one control, which is using another control
I have an asp.net page within which I've used several AJAX controls doing partial
I have a this asp.net page which upon first time load: 1: Make a
We have an asp app on which people can take tests. On the test
I have an ASP.NET website (c# as code behind) in which one of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.