Error: Dropdown list
-
Hi, I'm using Drop down list. List of Quesitons stored in a database. I'm collecting the questions and load it to the drop down list in Page load event. When I select the Drop down list, the selected question and answer will display in the text boxes name txtquestion, txtanswer. But I got this error when I select the Drop Down list "A potentially dangerous Request.Form value was detected from the client" The Questions and Answer having HTML tags. will it cause the Error? If so How can I Split the tags and load the Questions alone in the drop down list? Thanks in Advance
-
Hi, I'm using Drop down list. List of Quesitons stored in a database. I'm collecting the questions and load it to the drop down list in Page load event. When I select the Drop down list, the selected question and answer will display in the text boxes name txtquestion, txtanswer. But I got this error when I select the Drop Down list "A potentially dangerous Request.Form value was detected from the client" The Questions and Answer having HTML tags. will it cause the Error? If so How can I Split the tags and load the Questions alone in the drop down list? Thanks in Advance
Muthunagai.A wrote:
will it cause the Error?
Yes. You can turn it off with ValidateRequest="false" in your page definition.
Muthunagai.A wrote:
If so How can I Split the tags and load the Questions alone in the drop down list?
You can just use the HTMLEncode method ( not sure from memory what object it's on ), to change the text to not be HTML.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Muthunagai.A wrote:
will it cause the Error?
Yes. You can turn it off with ValidateRequest="false" in your page definition.
Muthunagai.A wrote:
If so How can I Split the tags and load the Questions alone in the drop down list?
You can just use the HTMLEncode method ( not sure from memory what object it's on ), to change the text to not be HTML.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Hi, I set the ValidateRequest as false. Include the System.Web.HttpUtility also. But Still having the same error
-
Hi, I'm using Drop down list. List of Quesitons stored in a database. I'm collecting the questions and load it to the drop down list in Page load event. When I select the Drop down list, the selected question and answer will display in the text boxes name txtquestion, txtanswer. But I got this error when I select the Drop Down list "A potentially dangerous Request.Form value was detected from the client" The Questions and Answer having HTML tags. will it cause the Error? If so How can I Split the tags and load the Questions alone in the drop down list? Thanks in Advance
U'r question is already in dropdwonlist so you can get question on your question textbox and in the event of dropdwonlist_selectindexchanged you get your answer from database and assign it to answer textbox event dropdwonlist_selectindexchanged txtquest.text=dropdwonlist.selecteditem Nand Nand