Problem while inserting html control in my database in Asp.Net
My problem is that I'm inserting HTML control using Server.HtmlEncode() method <a href=''>A开发者_开发知识库pply now!</a>
in my database through text box but whenever I'm inserting it throws an exception.
My Code is Here
textbox1.text=Server.Server.HtmlEncode("`<a href=''>Apply now!</a>`");
//Database entry
obj.html=textbox1.text;
You can either try to change
Server.Server.HtmlEncode(
to
Server.HtmlEncode(
or tell us more about what kind of exception you're getting, how do you update database etc.
精彩评论