473,605 Members | 2,590 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to display just the text of a marked up field?

44 New Member
Hi,

I have a table in mssql which holds the data i display on my "News" page. I wanted the user to be able to style the details of the news, so i store the details on a column with a text data type. i use freetextbox to let the user customize the details section of the news. It's working fine when i show the whole news on a page, with the Title on the header, and the author's name and date just below it. i display the details using a literal control. everything is fine right there.

Now i also have a page that lists all the news on a repeater. I just put the title in there, and the authors name and date. Now the client asked me to display just a preview of the details part without style. just plain small text. the problem is when i use label control for the details it shows the styling, i tried using the literal and put an attribute mode or a text box, but it shows the markup tag.

what i want is to just display the plain text with no styles and also not showing the html tags. Is there a way to do this?
Feb 28 '12 #1
1 1377
chibbie23
44 New Member
I really dont know how to phrase my problem back then, however i stumbled upon some answers after googling. The answer would be to use regular expressions to remove html tags.

something like this works, but not all the time:
Expand|Select|Wrap|Line Numbers
  1. lbl1.text = Regex.Replace(tbl.rows(0).item("details"), "<.*?>", "")
  2.  
Mar 2 '12 #2

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

Similar topics

1
9014
by: David Thomas | last post by:
Hi there, a while ago, I posted a question regarding reading japanese text from a text file. Well, since I solved the problem, I thought I'd post my solution for the benefit of other people with the same problem. The plan was to make a script to read and display japanese text. I will use it for making a japanese proverb script and for a japanese language study script.
4
4121
by: hoke | last post by:
I want to display plain text files in the browser. The files contain html and javascript and have a .txt extension. This works fine with files with just html. Unfortunately when showing files with javascript, I get an "error on page" warning and the page is not displayed. I suppose that when Internet Explorer discovers a <script> tag he starts to interpret it. This is not what I want. After all Internet Explorer is a browser and not an...
13
4770
by: Eddie | last post by:
I need to validate a text input field. I just want to say if user enters 93101 or 93102 or 93103 or 93105 or 93106 or 93107 or 93108 or 93109 or 93110 or 93111 or 93116 or 93117 or 93118 or 93120 or 93121 or 93130 or 93140 or 93150 or 93160 or 93190 or 93199 or 93199 or 93401 or 93402 or 93403 or 93405 or 93406 or 93407 or 93408 or 93409 or 93410 or 93412
2
4977
by: Kai Grossjohann | last post by:
I would like to put a text input field (in the sense of <input type="text">) and an image next to each other, where I know the size in pixels of the image, and I know the total width in em. I haven't found a way to do this. I tried <span style="width:20em"> <input type="text"> <img width="25px" src="...">
5
2989
by: simon_s_li | last post by:
Hi, I have 5 fields in line where I need to drag and drop the text from one field to another field and then all the fields need to re-order themselves. So for instance if I drag the text in field 1 to field 3, then field 2 text and field 3 move to field 1 and field 2. I add the new order of text into an array so when the onDragEnd event
2
3438
by: Gmansky | last post by:
I have a dataItem that is a text memo field. When I use <%#container.DataItem('memoText')%>, it displays it with no line breaks. Is there a function to convert the line breaks on the memo field? Thanks, George
4
7240
by: Tigrou | last post by:
Hello, In a Oracle Database i have text who are stored, this text are in RTF format, you can see an example below: {\rtf1\ansi\ansicpg1252\deff0\deflang1036{\fonttbl{\f0\froman\fcharset0 Times New Roman;}{\f1\fnil Verdana;}{\f2\fnil\fcharset2 Symbol;}} \viewkind4\uc1\pard{\pntext\f2\'B7\tab}{\*\pn\pnlvlblt\pnf2\pnindent0{\pntxtb\'B7}}\fi-200\li200\sb100\sa100\f0\fs24 Jusqu'\'e0 22 ppm en noir... I would like display this text in an...
3
3886
by: jiayanxiang | last post by:
Is there any sample code to use Javascript to load and display a text file? It will be best if the user can select files using some kind of explorer. If that's complex, a text box to specify the file name will be fine as well. Once a text file is selected, I just need to display it in a text box. Thanks for the help.
2
4856
by: jej1216 | last post by:
Using PHP to populate a form, I am not able to display any text area data -- it displays as blank. <?php echo "<textarea rows=11 cols=120 name=inc_descr value='".$incdescr."'></textarea>"; ?> The value might be "Patient stumbled on his shoelaces and fell to the floor. Staff were unable to get to the patient to break his fall." Using the code above, the text area is blank.
6
10786
by: aliasDyego | last post by:
Hi all, I am trying to display both text and image fields from MySQL in PHP page but unfortunately it doesn't work. Here is the code i used: $id = $_GET; $sql = "SELECT * FROM user, posteditem, upload WHERE user.userID = posteditem.userID
0
8004
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8418
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8071
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8288
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5886
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5445
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2438
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 we have to send another system
1
1541
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1271
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.