validateRequest and foreign characters

G

Guest

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?).
 
S

Steven Cheng[MSFT]

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 "validateRequest" 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/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.

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



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

Guest

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="SearchSubjectID" DataSourceID="SqlDataSourceEdit">
<ItemTemplate>
<asp:table id="tblEdit" CellSpacing="0" CellPadding="5" runat="server"
CssClass="Input">
<asp:TableRow ID="trLastName">
<asp:TableCell>
<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>
 
S

Steven Cheng[MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top