error while post back the page if any input control(textBox) has value &#

Im working in Asp.net 2.0 and Ajax 1.0

Im getting error while post back the page if any input control(textBox) has value &#

im not getting error even it has value #&

 Please help....

-1
ajith
11/13/2008 6:46:23 AM
asp.net.ajax-ui 9760 articles. 0 followers. Follow

2 Replies
827 Views

Similar Articles

[PageSpeed] 0

Hi ajith P T
 
The “&#” is a special word in HTML, it might be forbid during the postback because of the security issue.
If you need this in your TextBox, you can set the ValidateRequest="false" on your <%@ Page %> tag to avoid the error.
 
Just like the following demo:
  
<%@ Page Language="C#" ValidateRequest="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </div>
    <asp:Button ID="Button1" runat="server" Text="Button" />
    </form>
</body>
</html>
 

 
Thanks.

 


Lance Zhang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
1
Lance
11/17/2008 4:47:20 AM
You can disable request validation by setting the validateRequest attribute in the @ Page directive to false, as shown in the following example: 

<%@ Page validateRequest="false" %>

To disable request validation for your application, you must modify or create a Web.config file for your application and set the validateRequest attribute of the pages section to false, as shown in the following example:

<configuration> 
  <system.web> 
    <pages validateRequest="false" /> 
  </system.web> 
</configuration> 

This Indicates whether request validation should occur. If true, request validation checks all input data against a hard-coded list of potentially dangerous values. If a match occurs, an HttpRequestValidationException exception is thrown. The default is true.

This feature is enabled in the machine configuration file (Machine.config). You can disable it in your application configuration file (Web.config) or on the page by setting this attribute to false.


Chetan Sarode
Software Engineer,
Approva Systems Pvt Ltd,
Pune, India.
1
chetan
11/18/2008 3:38:40 AM
Reply:

Similar Artilces:

Menu control : Cross page posting and posted values in nested controls?
I've created a dyrnamic template for a menu control which renders either a textbox or a linkbutton. The textbox acts as an search input field. The value of this field then acts as input to another page(on another frame actually). What happens is that clicking on the linkbutton will do a postback to Main.aspx(which resides in a frame called 'MainWindow'). When the value arrives at Main.aspx, I see the value from 'searchMovies' textbox posted into the Request.form collection as : 'NavigationMenu$ctl05$searchMovies' with the value that was keyed in. From main.aspx, does anyone know...

Page not a post back choosing Controls Value
How can use java script for choosing controls value page not a refresh and Post Back Thanks   I'm not sure I understand what you are trying to do exactly? Are you just trying to get the value of a control from javascript? If so this is typically done like this:   var ctlValue = document.getElementById('myId').value;In this case the string myId is the id of the control you want to get the value for. So if I have a textbox in my html like this:   <input type="text" id="myTextBox" />I could get its value by doing:   va...

Validation error: No post back from input in textbox
Just got done converting project from 1.1 to 2.0.  Having trouble with validation though.  The issue is that the validation does not fire when an invalid character is input into a textbox (such as the letter A in a numeric only textbox). On my local machine, the project/application runs fine the validation fires without a problem.  On the server end though, the validation does not fire properly.  Both run from IIS here is a small difference though, the virtual directory on my local machine is directly under the website folder.  So if viewed from IIS the tree wo...

Post back clears out the value in Input Control
 Dear All, I am using html input control to upload images to database (with browse button). it is running at server. when I click on button to send data to Database, it clears out the file path or browsed file due to postback.any idea to read the file path before it clears out with click of send button.Thanks,  Can you post the code? Do you have EnableViewState="false"?CheersAlMy BlogMapStats.NETPlease click on 'Mark as Answer' if this post answered your question!  Are you talking about EnableViewState for Input control, if yes, then before it had no...

How to pass textbox control value from UserControl page(ascx) to Page Control(aspx).
I have 2 files(aspx and ascx). the aspx page  has a Web user control(ascx) in it.Once the button control click(in aspx) I want to get the value from the textbox(ascx) controland pass it to label control in aspx page.Can somebody help with this and please use VB.Thanks A simple search would have turn up many different solutions.  The easiest is to just expose the textbox value as a property in your control.  Then you can retrieve that value on the aspx page. Add this to your control: Public Property TextBoxValue() As String   Get   &...

How to do post back in a dynamically created user control [provided that update panel is in the master page of the page where user control is added] {B/C of FileUpload Control}
I have a register my scriptmanager and place the update panel around contenttempalte for my pages int the master page. Now in one of my pages i am adding some user controls dynamically. In two of my user user controls I have FileUpload control which will not work under partial post back. So I want's full postback for them How could I do that {Provided that i am on the user control,which is inside the page ,and page have the contenttemplat...

superreview requested: [Bug 85420] Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) : [ #4
Asaf Romano <bugs.mano@mail-central.com> has asked neil@parkwaycc.co.uk {holiday 20040928 - 20041007} <neil.parkwaycc.co.uk@myrealbox.com> for superreview: Bug 85420: Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) https://bugzilla.mozilla.org/show_bug.cgi?id=85420 Attachment 160969: Seamonkey patch - see next comment https://bugzilla.mozilla.org/attachment.cgi?id=160969&action=edit ...

superreview denied: [Bug 85420] Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) : [Att
neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> has denied Asaf Romano <bugs.mano@mail-central.com>'s request for superreview: Bug 85420: Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) https://bugzilla.mozilla.org/show_bug.cgi?id=85420 Attachment 160148: Seamonkey patch https://bugzilla.mozilla.org/attachment.cgi?id=160148&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> I fo...

superreview requested: [Bug 85420] Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) : [ #2
Asaf Romano <bugs.mano@mail-central.com> has asked Christopher Blizzard <blizzard@mozilla.org> for superreview: Bug 85420: Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) https://bugzilla.mozilla.org/show_bug.cgi?id=85420 Attachment 160148: Seamonkey patch https://bugzilla.mozilla.org/attachment.cgi?id=160148&action=edit ...

superreview granted: [Bug 85420] Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) : [At #2
neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> has granted Asaf Romano <bugs.mano@mail-central.com>'s request for superreview: Bug 85420: Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) https://bugzilla.mozilla.org/show_bug.cgi?id=85420 Attachment 160969: Seamonkey patch - see next comment https://bugzilla.mozilla.org/attachment.cgi?id=160969&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myr...

superreview granted: [Bug 85420] Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) : [At #3
Asaf Romano <bugs.mano@mail-central.com> has granted Asaf Romano <bugs.mano@mail-central.com>'s request for superreview: Bug 85420: Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) https://bugzilla.mozilla.org/show_bug.cgi?id=85420 Attachment 162328: Seamonkey: patch for checkin https://bugzilla.mozilla.org/attachment.cgi?id=162328&action=edit ------- Additional Comments from Asaf Romano <bugs.mano@mail-central.com> moving r/sr ...

superreview requested: [Bug 85420] Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) : [ #3
Asaf Romano <bugs.mano@mail-central.com> has asked neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> for superreview: Bug 85420: Need Bidi UI / Menu commands and keyboard shortcut for controling Page & Input fields (textarea) direction for specific locales (or when bidi.browser.ui is set) https://bugzilla.mozilla.org/show_bug.cgi?id=85420 Attachment 160148: Seamonkey patch https://bugzilla.mozilla.org/attachment.cgi?id=160148&action=edit ...

Page with AJAX controls posts back twice to the server
I have a form containing three AJAX UpdatePanels, two of which contain a pair of listboxes and a pair of buttons, with the third one containing a pair of radio buttons in a radiobutton list and either three CascadingDropDown lists or two CascadingDropDown lists and a textbox depending on which radio button is selected.  The only other control on my form is a button to submit the information on the form to the server. One thing I've noticed is the information gets posted back to the server twice when the button is clicked.  This causes a duplicate record to be written to two ta...

where is the value saved of the form controls(such as textbox) in post backs?
hello! I have some puzzle in view state.I have just read an article in Msdn about view state.http://msdn2.microsoft.com/en-us/library/ms972976.aspx,It says, there are many stages in the life cycle of the page,and the Stage 2 is Load View State,the Stage 3  is Load Postback Data.In Stage 2 ,it says : During this stage, the view state data that had been saved from the previous page visit is loaded and recursively populated into the control hierarchy of the Page. And the Stage 3 is Load Postback data of the form controls, My first question is: what is the difference of the view stat...

Web resources about - error while post back the page if any input control(textBox) has value &# - asp.net.ajax-ui

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

WA fires: Harvey set for evacuation as Waroona fires burn out-of-control
The WA town of Harvey is set to be evacuated as a bushfire that already destroyed Yarloop continues to rage out-of-control.

Widow of ‘American Sniper’ Chris Kyle Confronts Obama on Gun Control
... Virginia, on Thursday evening, as reported by Breitbart News. The event, telecast on CNN, followed Obama’s announcement of his gun control executive ...

Chipotle Sued For Not Disclosing Food Quality Control Problems To Stockholders
... afternoon . According to Reuters , the lawsuit claims that the burrito chain hurt investors by failing to let them know that “quality controls ...

Lyin' Ryan Shoots Blanks At Gun Control Policies
When President Barack Obama issued the executive order for reasonable gun control policies by closing the loophole regarding background checks, ...

Volvo Updates Its Car Control App With Voice Commands
Volvo owners will be able to turn on the heat, lock the car and other tasks using voice commands through a smartband for the first time.

DEBATING GUNS Obama takes aim at NRA, defends gun control push
DEBATING GUNS Obama takes aim at NRA, defends gun control push

Clinton and Sanders Trading Blows on Gun Control
Washington Post Clinton and Sanders Trading Blows on Gun Control ABC News Bernie Sanders and Hillary Clinton during the CNN Democratic presidential ...

Taya Kyle to Obama: Why do we need more gun control when the murder rate has declined?
... the White House) that a skeptic was allowed to speak at what was mainly an Obama photo op, it’s an easy point to answer if you favor more control. ...

Implant That Controls Sperm With On/Off Switch Could Become A Thing
... out of the pages of a sci-fi novel. A German carpenter named Clemens Bimek has invented a form of male contraception meant to let men control ...

Resources last updated: 1/9/2016 10:31:30 AM