473,382 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Posting from HTML form to WebForm

I am posting from a HTML form (below) to a aspx webform.
This works OK but I notice the £ character (pound sign) is dropped! i.e. not
picked up by a Request.Form["X"] in the webform e.g. input = 12£34, output =
1234

Please would anyone say why this is?

<body>
<form name="Form1" method="post" action="WebForm3.aspx" id="Form1">
<input name="X" type="text" id="X">
<input type="submit" name="Button1" value="TheButton" id="Button1" >
</form>
</body>

Nov 19 '05 #1
3 1444
Have you tried setting it to use unicode?
Here's more info on the subject:
http://msdn.microsoft.com/library/de...gbasetypes.asp

Also, have you checked the Globalization section of the web.config?
Try changing it to something more like this:

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
<globalization
fileEncoding="iso-8859-1"
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
/>
</system.web>
</configuration>

--
I hope this helps,
Steve C. Orr, MCSD
http://SteveOrr.net
"ChainsawDude" <an******@nospam.com> wrote in message
news:FB**********************************@microsof t.com...
I am posting from a HTML form (below) to a aspx webform.
This works OK but I notice the £ character (pound sign) is dropped! i.e.
not
picked up by a Request.Form["X"] in the webform e.g. input = 12£34, output
=
1234

Please would anyone say why this is?

<body>
<form name="Form1" method="post" action="WebForm3.aspx" id="Form1">
<input name="X" type="text" id="X">
<input type="submit" name="Button1" value="TheButton" id="Button1" >
</form>
</body>

Nov 19 '05 #2
Steve C. Orr [MVP, MCSD] wrote:
Have you tried setting it to use unicode?
Here's more info on the subject:
http://msdn.microsoft.com/library/de...ry/en-us/cpgui
de/html/cpconencodingbasetypes.asp

Also, have you checked the Globalization section of the web.config?
Try changing it to something more like this:

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
<globalization
fileEncoding="iso-8859-1"
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
/>
</system.web>
</configuration>


ISO-8859-1 is *not* Unicode.

The problem is that the HTML page uses its own encoding to submit the
data, which unless specified is ISO-8859-1. So either change the
globalization element (this can also be done by code BTW), or encode
the HTML page properly, i.e. save it with UTF-8 encoding and add a
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
tag to the page.

Note that there's little reason to downgrade requestEncoding and
responseEncoding from UTF-8 unless every single byte transmitted
counts, or content is solely intended for North American or Western
European users (excluding the French, who forgot to include some
characters in ISO-8859-1 ;->). I recommend encoding the HTML page
instead.

In theory, the form tag's "accept-charset" attribute allows one to
specify the encoding of form data regardless of the page's own encoding
or browsers settings, but this attribute lacks proper browser support.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #3
Marvelous and thank you very much.

"Joerg Jooss" wrote:
Steve C. Orr [MVP, MCSD] wrote:
Have you tried setting it to use unicode?
Here's more info on the subject:
http://msdn.microsoft.com/library/de...ry/en-us/cpgui
de/html/cpconencodingbasetypes.asp

Also, have you checked the Globalization section of the web.config?
Try changing it to something more like this:

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
<globalization
fileEncoding="iso-8859-1"
requestEncoding="iso-8859-1"
responseEncoding="iso-8859-1"
/>
</system.web>
</configuration>


ISO-8859-1 is *not* Unicode.

The problem is that the HTML page uses its own encoding to submit the
data, which unless specified is ISO-8859-1. So either change the
globalization element (this can also be done by code BTW), or encode
the HTML page properly, i.e. save it with UTF-8 encoding and add a
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
tag to the page.

Note that there's little reason to downgrade requestEncoding and
responseEncoding from UTF-8 unless every single byte transmitted
counts, or content is solely intended for North American or Western
European users (excluding the French, who forgot to include some
characters in ISO-8859-1 ;->). I recommend encoding the HTML page
instead.

In theory, the form tag's "accept-charset" attribute allows one to
specify the encoding of form data regardless of the page's own encoding
or browsers settings, but this attribute lacks proper browser support.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de

Nov 19 '05 #4

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

Similar topics

5
by: Magnus | last post by:
Hi! This is my problem: I want to go from page1 to page2, and to get all the form variables from page1 to page2. I have turned the viewstate and the sessionstate off, and i really just...
6
by: dave | last post by:
I have a webform with many checkboxes on it. I want the user to be able click on a button and the page be posted to another webform so that I can capture which checkboxes were selected. For all...
5
by: Rob Meade | last post by:
Hi all, Ok - I have a bit of a problem with a login page. Originally it was written in normal asp - the page displayed the form, the user entered their details, it posted back to itself,...
3
by: Rob Shorney | last post by:
Hi, How do I post the data from webform1.asp to webform2.aspx In classic asp you can use the request.form but when I do this in webform2 I get nothing. -- Regards
2
by: John | last post by:
Hi A client has provided an html sample page to be used as "template" for an asp.net enquiry form to maintain their intended look and feel. Info from the asp.net form is to be emailed on...
13
by: Ian.Suttle | last post by:
I am have been researching this issue to no end, so any help would be very much appreciated. I have a page with form tags. Inside of the form tags is a panel that contains a user control. The...
6
by: Andre Ranieri | last post by:
I'm trying to create a login page for customers to log into our corporate website, our presidents naturally wants the user and password fields to populate from a cookie so the customer doesn't have...
2
by: jlopes151 | last post by:
Question: I'm creating an ASP.NET webform and I have questions about how the ASP.NET form works. In ASP or HTML a form with an action will transfer that forms items to another page. From the...
7
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.