Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 April 19th, 2006, 05:24 PM
Registered User
 
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default clear the contents of controls on a page

Hi,

I have a basic question. I have a form with a textbox and check box and a datagrid and save button. After entering the text in text box and checking the check box and clicking the save button contents are added to grid. And my contents in the text box and check box are not cleared off.

I think this is something to do with view state and post backs.

what is the efficient way to clear off all my controls content after post back.

Thanks in advance.

Madhavi Gujja

 
Old April 19th, 2006, 09:46 PM
Authorized User
 
Join Date: Apr 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One of the differences between html control and web control is that html control can clear after posting back, but web control can't.
If you view the source of page, you will see the code like following example whose function is to save the web control info and display it after posting back.

<input type="hidden" name="__VIEWSTATE" value="dDwxNzY3ODc4MzI4OztsPE1vZHVsZUJhbm7Pj7sbd7l pUK5F1n7oFJus5Ob4uBEvw==" />

In my opinion, you need to clear all of the web controls by yourself.


:)¡¶
 Â¡Â¶Â¡Â¶ No pains, no gains.
¡¶¡¶¡¶
 
Old April 20th, 2006, 01:48 PM
Registered User
 
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dutguoyi,

Thanks for your reply.






Similar Threads
Thread Thread Starter Forum Replies Last Post
clear variables contents - Please URGENT!! hugoscp Classic ASP Basics 3 November 29th, 2008 07:21 PM
Reading contents of other window controls furqanms C# 2005 0 June 15th, 2007 02:04 PM
Emailing the contents of an aspx page Mykhan ASP.NET 2.0 Professional 3 December 15th, 2006 03:41 AM
How to protect the contents of web page Aaronmeng ASP.NET 2.0 Basics 0 October 24th, 2006 08:55 PM
Accessing page contents from browser cache baburman General .NET 0 December 6th, 2004 01:44 AM





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