473,785 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

validateRequest and foreign characters

I get an error on a .net 2.0 page when I use foreign characters, such as ç or
ã. Setting validateRequest =false handles this, but is there a way to keep
validateRequest =true but allow foreign characters? I don't see how these
would be dangerous (am I missing something here?).
Mar 23 '07 #1
3 2096
Hi Gerhard,

From your description, you're getting some validation error when post some
foreign characters through ASP.NET page(with validateRequest turn on )
,correct?

According to the characters you provided, I have performed some test in my
local environment and seems faild to repro the exact behavior. Here is the
test I performed:

** create ASP.NET 2.0 web site application, request/response charset is
UTF-8

** create a very simple ASP.NET 2.0 page with "validateReques t" turn on in
@page directive

** when run the page, input those problem characters you mentioend and
submit the page, no error raised.

Are you also using input text element to submit such text/characters? Or is
there any other invisible characters that could be embeded in the submit
string or whether the request/response page charset is UTF-8 also?

Anyway, please feel free to let me know if there is anything I missed or if
you have any other finding on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 26 '07 #2
To duplicate it, you would need to put a text box inside a FormView. Below
is a snippet of code, where the foreign characters were in the LastName field
that was returned:

<asp:FormView ID="FormView2" runat="server"
DataKeyNames="S earchSubjectID" DataSourceID="S qlDataSourceEdi t">
<ItemTemplate >
<asp:table id="tblEdit" CellSpacing="0" CellPadding="5" runat="server"
CssClass="Input ">
<asp:TableRow ID="trLastName" >
<asp:TableCel l>
<asp:TextBox Runat="server" ID="LastName" Text='<%# Bind("LastName" )
%>'></asp:TextBox>
</asp:TableCell>
</asp:TableRow>
</asp:table>
</ItemTemplate>
<RowStyle CssClass="input " />
<EditRowStyle CssClass="input " />
</asp:FormView>
"Steven Cheng[MSFT]" wrote:
Hi Gerhard,

From your description, you're getting some validation error when post some
foreign characters through ASP.NET page(with validateRequest turn on )
,correct?

According to the characters you provided, I have performed some test in my
local environment and seems faild to repro the exact behavior. Here is the
test I performed:

** create ASP.NET 2.0 web site application, request/response charset is
UTF-8

** create a very simple ASP.NET 2.0 page with "validateReques t" turn on in
@page directive

** when run the page, input those problem characters you mentioend and
submit the page, no error raised.

Are you also using input text element to submit such text/characters? Or is
there any other invisible characters that could be embeded in the submit
string or whether the request/response page charset is UTF-8 also?

Anyway, please feel free to let me know if there is anything I missed or if
you have any other finding on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 28 '07 #3
Thanks for your reply Gerhard,

According to your further description, I have used a page that contains
FormView and nested Table to hold the TextBox (in ItemTemplate). However,
it seems those problem characters can still be correctly submit to server
without any validate exception. I've put those characters in database and
bind them through <% # %expression. BTW, are you getting the exception
when you try submit/postback the page?

If possible, can you send me a simplified page (has hardcode characters in
aspx template) that can repro the issue? I'll help perform some further
test on my side.

If there is any other finding on this, please feel free to post here also.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 28 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
8213
by: Toffe | last post by:
Hi, I've got a problem with regular expressions and strings containing Swedish characters (åäö). I basically have a PHP script that highlights certain words in a text. I found the code attached below in the commented manual at php.net. It works great for all words that do not contain Swedish characters. The words that do contain åäö will not be highlighted.
13
2507
by: Xah Lee | last post by:
the Journey of Foreign Characters thru Internet Xah Lee, 20051101 There's a bunch of confusions about the display of non-ascii characters such as the bullet "•". These confusions are justifiable, because the underlying stuff is technology, computing technologies, are in a laymen sense, extremely complex. In order to be able to type the bullet char, post it to a newsgroup,
1
1341
by: Benny | last post by:
Hello Experts, If the contents of a text box containing a html tag like formmated characters, i.e. <hello>, and if the validateRequest is set to true, it gives an error when post back: A potentially dangerous Request.Form value was detected from the client. Just wondering what are the drawbacks if the validateRequest is set to true? Under what situations should the validateRequest set to true or false? Thanks,
4
6377
by: Ray Williams | last post by:
I have a specific page that I have chosen to disable the .NET 1.1 validateRequest options by setting the page directive attribute of "validateRequest" from true to false. I manually validate all controls within this page. This page includes a UserControl which contains a textbox. It appears that the validateRequest attribute is not propagated to the usercontrol when the page is processed. This results in the standard "potentially dangerous"...
2
1393
by: AFN | last post by:
I have a form with 15 fields. I want users to be able to enter "<" and ">" characters into 1 of those fields without IIS catching it and disallowing the whole page. I did some reading and I *think* that means I MUST set ValidateRequest=False. So, two questions: 1) Do I have to then pass the results of every one of those 15 fields into HtmlEncode? like strAfter = HtmlEncode(txtField1.text)? That's annoying when I only want to...
8
1868
by: Max Metral | last post by:
Ok, I have a global page class derived from System.Web.UI.Page, let's call it BasePage. I have another class derived from that called MemberPage. It checks the Form collection if it's a post for some "common" fields. Now, I have an aspx page whose code behind derives from BasePage, and which sets ValidateRequest=False in the page directive of the aspx. I can post <script> tags and such with no problems. However, when I make the...
2
2997
by: Andy Fish | last post by:
Hi, I have one textbox on the form that needs to have ValidateRequest disabled, but it seems that it can only be enabled/disabled at a page level. assuming I have to disable it at for the whole page, how can I invoke ValidateRequest functionality for the other text boxes individually? I was looking for some kind of method on I can call that says "validate this control as if ValidateRequest were true" or a function "would this string...
2
2067
by: \A_Michigan_User\ | last post by:
*WITHOUT* using: ValidateRequest="False" for the whole page (or my whole site).... How would I trap/detect that a textBox contains some illegal characters? (I'm using asp.net v1.1 and vb.net) Thanks.
0
1506
by: \A_Michigan_User\ | last post by:
I guess I'm not understanding this correctly. I have to set "ValidateRequest=False" for my asp.net 1.1 page that has a TextBox... so that I can avoid an error... if some user enters some html or script coding into it. (Should I HtmlEncode it with Server.htmlEncode or HttpServerUtility.HtmlEncode ???) From what I've read... I guess I'm supposed to do it this way: 1. HtmlEncode the user input that's in the TextBox. 2. Save it to the...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.