473,474 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HyperLink in InnerHtml or Innertext

rrocket
116 New Member
I am creating a table through the codebehind with info from a XML string. I would like to create a link from the text in one of the cells.

Here is the best example that I came up with of what I need to do:
Expand|Select|Wrap|Line Numbers
  1. string linkstring = "<a href=\"http://website.com?TrackingNum=" + sArray[TrackNum] + ">" + sArray[TrackNum] + "</a>";
  2.  
  3. TrackDetailsCell.InnerText = linkstring;
  4. //or
  5. TrackDetailsCell.InnerHtml = linkstring;
  6.  
I need to have some info in the link so that another page can pull the values from the query string. Any ideas of how to get this to work? Thanks.
Mar 24 '08 #1
3 2550
kunal pawar
297 Contributor
did u read about table control. this property is not support for table control. so u have u used another way.
U should use repeater / datalist control also. or u can create table from code behind
Mar 25 '08 #2
rrocket
116 New Member
did u read about table control. this property is not support for table control. so u have u used another way.
U should use repeater / datalist control also. or u can create table from code behind
I actually am creating the tables from the codebehind. Here is what I was looking for.

Expand|Select|Wrap|Line Numbers
  1. //This will create the hyperlink
  2. HyperLink TrackNumLink = new HyperLink();
  3.                 TrackNumLink.Text = sArray[TrackNum];
  4.                 TrackNumLink.NavigateUrl = "http://www.website.com?TrackingNum=" + sArray[TrackNum];
  5.  
  6. //This will apply it to the cell of choice
  7. TrackDetailsCell.Controls.Add(TrackNumLink);
  8.  
Mar 25 '08 #3
Plater
7,872 Recognized Expert Expert
The backend code version of tables automatically escapes text you put in it (so putting in HTML code like your first try would get escaped into things like &lt; and such). Using the HyperLink object is the way to go.
Mar 25 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Kerri | last post by:
Hi, I have a span as below. <span id="lblTest" style="color:#FF0033;font- weight:bold;">This is a test.</span> When the user clicks a checkbox I call below code to set my span text to...
2
by: Billy | last post by:
I want to make a calendar and add a hyperlink to the days inside the calendar. The source code is below: <body> <SCRIPT LANGUAGE="JavaScript"> var now = new Date();
14
by: catorcio | last post by:
I'm trying to have some text in my page changed by clicking a button. Googleing around I've discovered that innerText doesn't work with every browser, so I've switched to innerHTML. It works fine...
3
by: nLella | last post by:
Hello, Is there any way where, from server side, I can access the innerHTML value of a control (Hyperlink/Label) which is modified at the client side ? I wish to read the changed InnerHtml on...
7
by: Hoss | last post by:
Hello all- This is what im trying to achieve. At the top of my page there is some search functionality, through which you cause to be loaded a string representing an HTML page. Below this and...
4
by: uwe.braunholz | last post by:
Hello, I want to set the text of a marqee dynamical. So I created the following code: ****snip**** <style> #noticeMarquee { background-color:#ff00ff; color:#ffffff;
5
by: laredotornado | last post by:
Hi, How would I use Javascript to get the value of a hyperlink. That is, what function could I substitute below to get the value "2"? <a href="javascript:alert( /* WHat goes here? */...
6
by: CES | last post by:
All, Visual Studio 2005 doesn't include an auto complete item for innerHTML document.getElementById("SomeID").innerHTML, is their a way of referencing the inner text of an element without using...
1
by: bekkem | last post by:
how to give a hyperlink to view in the following code <script language="javascript" type="text/javascript"> function addtoGrid(){ alert("working"); var...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.