Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,

In my application if User enters value as < name > in textbox. then when viewing this user information it shows the blank value for name. why this appear and is there any solution for it? Plz help me
Posted
Updated 16-Oct-12 1:28am
v3
Comments
AshishChaudha 16-Oct-12 7:23am    
Incomplete question. What you are trying to say, please elaborate your question. and also provide some code snippets..about what you are trying to do.
Richard MacCutchan 16-Oct-12 7:31am    
This happens because there is a bug in your code; the solution is to fix the bug. Now, if you explained exactly what your code is doing, we may be able to help you with that solution.
TheCoolCoder 16-Oct-12 7:39am    
I think what he is trying to say is he inserts '<name>' into the database from a textbox in a form and while viewing the data the textbox doesnt display '<name>'. This is most probably an issue with htmlencoding but dont want to keep guessing anymore :D, this is about the limit...

1 solution

that is because string < name > is interpreted by browser as html tag. So before saving data to your data store OR before displaying you have to Htmlencode it. Please refer... http://msdn.microsoft.com/en-us/library/w3te6wfz.aspx[^]
 
Share this answer
 
v3
Comments
Samsani.v.s.Durga Prasad 16-Oct-12 8:00am    
Hi put label enableviewstate=false

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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