473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Link does not print properly

Sl1ver
196 100+
currently I have this text

Expand|Select|Wrap|Line Numbers
  1. sData +=    "<tr> \n" +
  2.                             "<td> \n" +
  3.                             "<a href=\"title.aspx?titleid= "+dr["inttitleId"].ToString() + ">" + dr["vcTitleName"].ToString() + "</a> \n" + " (" + dr["vcCertificate"].ToString() + ") " + dr["intyear"].ToString() + "<br /><br />\n" +
  4.                             "Starring: " + dr["actor"].ToString() + "<br /><br />\n" +
  5.                             "some text for testing purposes <br />\n" +
  6.                             "</td> \n" +
  7.                             "</tr> \n";
  8.  
Now if that link is not a link(when i remove the code) it prints fine and even with the link it prints fine.

BUT it basically send me to the page with everything including all the text after the link even though I closed the a tag. What am I doing wrong?
Oct 5 '11 #1
5 1518
Frinavale
9,735 Expert Mod 8TB
When the page is displayed in the browser, right click on it and view the code. Look for the link... you've probably got invalid HTML in there somewhere.

To avoid problems like this you should use ASP.NET controls like the GridView, or Repeater. You can add links, text, etc. into to these controls by binding to data in a "Data Source" that you provide to them.

You do not have to generate HTML in your C# (or VB.NET) server-side code in ASP.NET



-Frinny
Oct 5 '11 #2
Sl1ver
196 100+
Thanx for the advice, do you perhaps know of a good tutorial on how to use a repeater with paging capabilities?
Oct 6 '11 #3
Frinavale
9,735 Expert Mod 8TB
Check out the MSDN documentation on the Repeater class. There are walkthroughs in the article (scroll down past all of the properties, methods, and event documentation links to find them).

-Frinny
Oct 6 '11 #4
Sl1ver
196 100+
Thanx, I have already implemented a repeater and it works so much better from a HTML point of view.
Oct 6 '11 #5
Frinavale
9,735 Expert Mod 8TB
Yeah they're pretty cool :)
Oct 6 '11 #6

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

Similar topics

3
by: NetNoise | last post by:
Hi. My friend used frames and layers to create: http://www.cooleycom.com/ccbeta/index.html He noticed that the page doesn't lay out properly for print. Can you give any advice as to how to...
3
by: Hasani | last post by:
I tried using webBrowser.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER) but it returns asynchronously. Is there anyway I can know when the document has...
3
by: Quintus Snapper | last post by:
Hi All, I'm having a problem with an anchor link in IE which is working inconsistantly and I can't figure out why. On the following website: http://www.friendlyrentals.com/ If you click...
3
by: John Spiegel | last post by:
Hi all, I'm trying to do something simple here...just provide a link from which a user can download a file. I'm using Server.MapPath() in my codebehind to find out physically where the file is...
0
by: dermot | last post by:
Hi, I have an asp.net application called communityCarers It has a folder called download with a file called reporting.adp in it. I have a link on my site...
2
daJunkCollector
by: daJunkCollector | last post by:
Hey, I have a simple web app that requires the user to click a text link to add a section to the form. As you will see from the following code (PHP/mySQL), the link inserts a row into the database...
6
Undertkr
by: Undertkr | last post by:
I just installed SMF today with out any real hitches, except for this one... I have a menu bar on my site and the link in the bar does not open the Forum, instead it goes to my opening page of my...
1
by: t flowers | last post by:
Please give me an example why print 038 returns an invalid token error.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.