How can show html tag in lable from data base

Posted by Umeshdwivedi under ASP.NET on 4/10/2011 | Points: 10 | Views : 2128 | Status : [Member] | Replies : 8
Dear All
i developing a blog project in asp.net but i face some problem any one solve this
problem is this
when i insert the data in database data is correctly insert and when i insert some html tag and some other asp.net tag then problem
when i show data in a lable then data is hide or if i inserted code of dropdown then its is appear a dropdown in lable
what can i do
i want to do that if i insert any html code in database this code react like a simple text not like code

Latest Technology Trainer
And Part time software consultant



Responses

Posted by: Gsolvers on: 4/10/2011 [Member] Starter | Points: 25

Up
0
Down
Have yoy tried using HTMEncode? I understand your question and i have done some fixes around this before but i will need time till tomorrow. Can you check this with HTMLEncode//

Best Regards,

VG
www.TeacherJi.com

Umeshdwivedi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 4/11/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Check this link

http://stackoverflow.com/questions/1592150/storing-html-content-and-other-documents-pdf-word-excel-in-sql-server

As a personal experience, its not worth to save the complete html to a database, for this u can save it in local file itself... this way u can avoid using a database and also it will reduce ur hosting cost!!!

Thanks
Karthik
www.f5Debug.net

Umeshdwivedi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Umeshdwivedi on: 4/11/2011 [Member] Starter | Points: 25

Up
0
Down
Dear Sir
i develop a blog project for my b-tech final year sem.where in blog project user will insert any post or ant text content text may be html if bloger post any programming post so i want that if user post any thing into database this text react like simple text,and i want to show post in datalist view so waht can i do pls suggest me

Latest Technology Trainer
And Part time software consultant

Umeshdwivedi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Umeshdwivedi on: 4/11/2011 [Member] Starter | Points: 25

Up
0
Down
Dear sir
this good one option and i used litral control but i want to show in DataList view so pls suggest me what can i do

Latest Technology Trainer
And Part time software consultant

Umeshdwivedi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 4/11/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
OK umesh... let me check it out if any samples i can get for you...

Thanks
Karthik
www.f5Debug.net

Umeshdwivedi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Umeshdwivedi on: 4/11/2011 [Member] Starter | Points: 25

Up
0
Down
Dear sir'
pls solove my problm very soon it very urgent for me

Latest Technology Trainer
And Part time software consultant

Umeshdwivedi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 4/12/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi umesh .


i am face same problem in my project . . but literal control is reliable option for do this . try it . . why u use DataLiSt

Best Regard's
Prabhakar

Umeshdwivedi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SurajRane on: 4/12/2011 [Member] Starter | Points: 25

Up
0
Down
Use Server.HtmlEncode() function for converting enterd text to normal text.
store this text in database. (HtmlEncode will convert your tags like <img> to &lt;img&gt; )

while you retrive this. you have to convert it back to origional format like ( &lt;img&gt; to <img> ). for this use Server.HtmlDecode() function.

you can display it any control like TextBox,TextArea etc.

Umeshdwivedi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response