 |
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

April 22nd, 2008, 09:51 AM
|
Authorized User
|
|
Join Date: Apr 2008
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
HTML tag problem
Hi,
I'm new to C#. I have some basics. I have a problem. In one login form, if i put in username text box one html tag ('< br >') it show me one error : Sys.Webforms. PageRequestManag erServerErrorExc eption: An uknown error occurred while processing the request on the server. The status code returned from the server was: 500
You have any suggestion how to fix this?
Thank you
__________________
Thank you
|

April 22nd, 2008, 09:58 AM
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
HTTP Status 500 is an Internal Server Error, which normally denotes some problem with the application running on it in my (limited) experience.
The <br> tag is a HTML tag for a Line Break? Where are you using this tag in your login form? Can you paste the sample of that part of the code (not all of it please)..
Rob
http://robzyc.spaces.live.com
|

April 22nd, 2008, 10:23 AM
|
Authorized User
|
|
Join Date: Apr 2008
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
I don't need the html tag. The problem is that my application will crash if someone will put that tag into my username text box. I want to prevent that from happening. So, I need someway to test or remove the html tags from my text boxes. I heard something about Regular expressions .
I can paste here some code , but I don't know if will help you.
Thank you
|

April 22nd, 2008, 10:28 AM
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Ah OK, now I am with you.
I am unsure as to why that would make a difference, since the login should just be treated as a string, completly ignoring any HTML in there regardless.
There are a number of ways you can do this, removing characters, RegEx would prob be the best option, but sadly my RegEx knowledge is limited, maybe someone else here will be able to help more :)
Rob
http://robzyc.spaces.live.com
|

April 22nd, 2008, 10:36 AM
|
Authorized User
|
|
Join Date: Apr 2008
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
I hope I'll solve this problem. I'll try to do something with regular expressions, after I find something to read about that.
Anyway , thank you very much for your time
Thank you
|

April 22nd, 2008, 10:40 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I think you are running into a validation mechanism from ASP.NET, helping you to prevent cross-side script and other injection attacks.
The technique is called Request Validation and can be turned off. However, you are advised to do this only if you take other preventive actions. For more info see: http://www.asp.net/learn/whitepapers...st-validation/
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
|

April 22nd, 2008, 11:00 AM
|
Authorized User
|
|
Join Date: Apr 2008
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Yes, it's working.
Thank you Imar, it was a great help
Thank you
|
|
 |