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 July 4th, 2003, 10:14 AM
Authorized User
 
Join Date: Jun 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Web forms - validation controls

Hello,

I noticed something interesting about the Page object, and was wondering if I'm missing something or if this is by design.

When submitting a form (using a button_click event on a codebehind page), you can refer to the controls using this.controlname.Text. But if populating a form with values from a database you'd like to edit (using this.controlname.Text = [database value] in the Page_Load event), you can't use this property, because if you change a field value, this.controlname.Text still points to the original value you set -- you have to use Request.Form["controlname"]. It took me awhile to figure this out, because I'm using a RequiredFieldValidation control, and even though I entered new data into a field the validation control is checking, Page.IsValid is still false. This is because the previous value (that was pulled from the database) was null, and the RequiredFieldValidation control checks the old Page value, not the new Request.Form["controlname"] value. Am I doing something wrong? Has anyone else experienced this, and if so, is there a workaround? or is this by design?

Thank you in advance.
__________________
Steve
iTek Corporation
http://itekcorp.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Standalone validation + web form validation morbo Struts 0 August 19th, 2008 04:02 AM
Validation Controls andyj00 ASP.NET 1.0 and 1.1 Professional 3 June 9th, 2005 09:19 AM
validation involving 2 controls Renu ASP.NET 1.0 and 1.1 Basics 24 December 21st, 2004 06:33 AM





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