Click here to Skip to main content
15,912,756 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,

I am storing the values into the database with some HTML tags. When I retrieving that values it should display it in a textbox like if I am saving the value like Manchestor it Should display in bold in the textbox and if I save as manchestor
Sanfrancisco it should display like

manchestor
Sanfrancisco

Thanks in Advance
Posted

Here storing the HTML text in the database may not be an issue. The main issue is to have suitable control which can render the text as desired.

For this purpose I think the control given in the this CodeProject article
A Professional HTML Renderer You Will Use[^]
may be helpful.
 
Share this answer
 
Comments
Maciej Los 16-May-12 11:13am    
Super lnik, my 5!
VJ Reddy 16-May-12 11:30am    
Thank you, losmac :)
Sandeep Mewara 17-May-12 1:09am    
Good one. 5!
VJ Reddy 17-May-12 1:49am    
Thank you, Sandeep :)
C#
SqlParameter Screenname = new SqlParameter("@ScreenName", GlobalList[count]);
                Screenname.SqlDbType = SqlDbType.VarChar;
                SqlCommand cmd_sel = new SqlCommand("Select * from userInfo where ScreenName=@ScreenName ", con);
                cmd_sel.Parameters.Add(Screenname);
                con.Open();
                SqlDataReader dr = cmd_sel.ExecuteReader();
                if (dr.Read())
                {
                                        str.AppendFormat("<ul> <div>  <div> <div>  ");
                    str.AppendFormat("<li> <input type=\"button\" id=\"btnTextChat\" value=\"TextChat\" /> </li>");
                    str.AppendFormat("<li><input type=\"button\" id=\"btnSendMessage\" value=\"Send Message\" />  </li> ");
                    str.AppendFormat("<li><input type=\"button\" id=\"btnAudioVideoChat\"  value=\"Audio-Video Chat\" /> </li>");
                    str.AppendFormat("<li><input type=\"button\" id=\"btnWink\" value=\"Wink\" /> </li>");
                    str.AppendFormat("</ul> </div>  </div> </div>  ");
                    count++;
                }
                con.Close();
 
Share this answer
 
v2

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