Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

How to add hyperlink dynamically in html?

4 Answer(s) Available
Answer # 1 #

To create a hyperlink for an external page using HTML, you can use the element with the "href" attribute, like this: phpCopy codeVisit Example.com The value of the "href" attribute should be the URL of the page you want to link to.

[5]
Edit
Query
Report
Dalia Scardino
Production Manager
Answer # 2 #

hai .. i'm intending to create a flash news kinda feature to my site.. i want to retrieve certain data in my database and i want to place it inside the marquee.. now i want to add a link in it which on clicking will redirect it to a page.. on goin to the page the full news is displayed .

Now My problem lies in here.. when i try with the hyperlink that is when i try to insert the hyperlink the data is not displayed.. And when i use the link, though the data is displayed, i cannot click it..

I'v made a particular cell in the table as "runas server" and has an id called as "newscell"

i'm posting the code below

ArrayList hypers = new ArrayList();         #region adding marquee tag in the begining         string marqueebeg = "";         string marqueeend = "";         #endregion         #region gathering all text and assigning target urls to the hyperlinks created        // newscell.InnerHtml = marqueebeg;         newscell.InnerHtml = marqueebeg;         for (int i = 0; i < nc.Count; i++)         {

#region link             //Link             string lin = two.getnewstext(int.Parse(nc[i].ToString()));// gets the data to be displayed             string targ = @"~/newspage.aspx?num=" + nc[i].ToString();             string a1 = "" + lin + "";             newscell.InnerHtml += a1;             newscell.InnerHtml += "
"+"
";             #endregion       }         newscell.InnerHtml += "";         #endregion

[3]
Edit
Query
Report
Satvinder cqgky
MOTOR POLARIZER
Answer # 3 #

The following URL demonstrates the problem http://www.aircrafttrafficsurvey.com/?page_id=1303

You will see two images of aircraft which are the hyperlinks. The first one passes the value for the Location (working) the second passes the postcode (failing i.e. gets truncated) but as you will see the postcode appears okay on the page.

The hypertext links are as follows;

works!

Truncates!

[3]
Edit
Query
Report
Deborra-Lee Jager
Geologist
Answer # 4 #
  • Insert the Dynamic Tag you'll be using into the text of your resource. Note: At the top (anywhere) is fine - you'll remove it in subsequent steps.
  • Click the Source button at the top of the toolbar (< > symbol)
  • Find and Cut (Ctrl+X) the Value for the Dynamic Tag (ex. [[Username|_4]] )
[1]
Edit
Query
Report
Yulia Wimperis
Ballet Historian