Click here to Skip to main content
15,915,065 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all

i m create a mini blog project in asp.net
i faces some problem in project
1-when i insert any programming text into data
and when i show this data into list view or lable this is not react as text
this generate html code
like-if i insert dropdwon list code this show in lable as dropdwon not react as text
i want to show data into text format
Posted
Comments
Sandeep Mewara 10-Apr-11 12:42pm    
Can you share a little code for users to look at? Little difficult to understand and suggest here.
xdfcvb 10-Apr-11 13:04pm    
Dear sir
when i insert any htnl tag into database and show other page in a label or gridview this html tag not react as other text its react as html tag like
if i insert this code into database
<select id=”mySelect”></select><br />
<input type=”text” id=”newOption” />
<input type=”button” value=”Add a new option to the drop-down”
önclick=”addOption(document.getElementById(‘newOption’).value);” />

now i want to show this code show in a grid or lable like the text format not in code format

when i show this code in a lable or grid this is make an dropdwon menu so what can i do pls help
xdfcvb 10-Apr-11 13:07pm    
Dear sir
can you give ur email id i want to send my full project pls check and suggest me

this sounds like you want to display html as text, for that follow this style

<asp:Literal runat="server"     Text  = "<select><option>option1</option><option>option2</option></select>" Mode=Encode ></asp:Literal>


let me know if this doesn't work.
 
Share this answer
 
Comments
xdfcvb 11-Apr-11 5:31am    
Dear sir
thanks its work but if i show this code in dataList view how can show in list view
xdfcvb 11-Apr-11 6:13am    
Dear Sir how can show this Liteal in Datalist view,i want to show in listview
Ramu Sangabathula Original 11-Apr-11 18:29pm    
where do you want to show exactly, datalist or listview
xdfcvb 11-Apr-11 23:23pm    
Dear Sir
i send you my code where comment show in Datalist pls check it and add the code which is provided by you...

<asp:DataList width="100%" id="RecComments" RepeatColumns="1" runat="server">
<itemtemplate>
<div class="divwrap2">
<div class="divbd2">
Author: <%# DataBinder.Eval(Container.DataItem, "AUTHOR") %>
<br />
Email: <%# DataBinder.Eval(Container.DataItem, "EMAIL") %>
<br />
Date:  <%# FormatDateTime(DataBinder.Eval(Container.DataItem, "DATE"),vbShortDate) %>
<br />
Comment:
<br />
<%# Replace(DataBinder.Eval(Container.DataItem, "COMMENTS"), Chr(13), "<br>") %>
</div>
</div>

XML
<asp:DataList ID="DataList1" runat="server" CellPadding="4" ForeColor="#333333"
           Width="115px"   >

            <ItemTemplate>

                 <%# DataBinder.Eval(Container.DataItem, "EmpId")%>


                 <asp:Literal runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "EmpHtml")%>' Mode=Encode></asp:Literal>

           </ItemTemplate>



       </asp:DataList>


and pass the EmpHtml html text
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900