Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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
 
Old September 6th, 2004, 11:00 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default Server Side html tag validations for Textbox

Hello
i am newbie

I have created a form for users to edit text for website.
I am using textbox with multiline to display existing record then edit it and update it.

I only want to allow user to use html tags inside the textbox:
<br>
<b>
<i>
<a href="mailto:someemailaddress.com">Email me</a>


I would imagine i would need to take content of textbox and parse it.
I don't know how to do this.

Can you show me some code for this??

 
Old September 6th, 2004, 07:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

You want to email the contents of the textboxes to mail to yourself?

Brian
 
Old September 11th, 2004, 01:47 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default

bmains,
Email address can be any email address. The content of textbox will be updated in dataset which will be evently updated into SQL Server.

I want certain html tags to be allowed to be used in textbox and all other tags to not be allowed. This is a textbox validation that allows 4 types of html tag (<br>,<b>,>/b>,</i>,<i>,<a href="mailto:someemailaddress.com">Email me</a>).

I would imagine I need take the contents of textbox and parse it to check for any html tags. The four above are allowed and all others will throw an exception.

How do you do this in ASP.Net using VB.Net?

 
Old September 13th, 2004, 07:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

You need to use Server.HtmlEncode to encode the text; otherwise, you may have some complications arise. Use Regular Expressions, which would be the best way (System.Text.RegularExpressions).

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox Validations using javascript jithendar84 ASP.NET 1.0 and 1.1 Basics 2 January 18th, 2008 03:12 PM
HTML tag from C# or ASP.NET tag from javascript angshujit ASP.NET 2.0 Basics 3 February 16th, 2007 10:07 AM
HTML tag vs Body Tag CFGerry BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 October 7th, 2005 07:13 AM
Client side validations tsimsha General .NET 4 November 18th, 2004 11:03 AM
How To Type the text of html tag in TextBox 6cet6 ASP.NET 1.0 and 1.1 Basics 3 November 6th, 2003 05:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.