Posted on: 8/15/2013 9:28:01 PM | Views : 788

hello
I am currently working on a project where we want to allow special characters in the input fields in the form. I have set the ValidateRequest = false on one of the pages. Now, there are two ways in which I was able to successfully encode and decode the individual control values:
Method 1: In the control itself  set the text value as follows: 
<asp:TextBox ID="txtName" runat="server" Text='<%# Server.HtmlDecode(Eval("Name")) %>'>
Method 2: In the vb.net code, I explicitly perform Server.HtmlDecode as follows:
If TypeOf (Control) Is TextBox Then Dim c As TextBox = CType(Control, TextBox) c.Text = Encoder.HtmlEncode(c.Text)
Endif

I want to rather do this in a third way. I want this to happen in Javascript. So basically, I want a javascript that would do the following:
Loop through all the controls in the page
If control type ...

Go to the complete details ...