473,386 Members | 1,702 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,386 software developers and data experts.

need to clear controls while postback

Hi

I have an problem in asp.net code behine vb.net. :confused: I need to clear the controls while postback the page. eg:- i am getting the input of an child information(name, age, qualification, address, and so on), when i click the (save)button the present information should save in database and clear the control to accept the information for the second child in a single page itself.

My problem is after i click the save button, the data are saved in database, but the controls are not clear for getting the second child, controls are retain the previous information. i need to clear controls while getting information for 2nd child :confused:
hope u may get my problem


Bye
Prabhu
Aug 3 '06 #1
3 2492
axas
32
You can use the method Clear() for each control, and after that, you can load them again. For example for the object DropDownList ddl, you write:

ddl.Items.Clear();
Aug 3 '06 #2
rajulg
2
In the button click event set each control's text property to textbox1.text="".

Hope it will work.
Aug 3 '06 #3
dotnet
22
On page load event of your of your page re-initialize all controls to have blank values.
Aug 3 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sam | last post by:
I have a custom control (MyTextBox - taken from Microsoft website) that implements the IPostBackDataHandler interface. It is added to the controls collection of a placeholder control during the...
6
by: Glenn Owens | last post by:
I have an ASP.Net page on which there are serveral static controls (listboxes, radiobuttonlist and textboxes). These controls are used to create criteria from which the code-behind will dynamically...
3
by: jw56578 | last post by:
When a page does a post back and there is data in a textbox, that textbox will get automatically repopulated with that data due to the posting of the form. Disabling viewstate has no affected on...
5
by: Psych971 | last post by:
Hi, I'm wondering how I can generate a postback using javascript on a page that does not have any controls with the auto-postback property set to true. I know I can just use the submit() function...
1
by: Adrian Parker | last post by:
At postback time, the controls are all recreated before an event fires. If the event determines that some of the controls need to be replaced with different controls that you can't create as...
2
by: John | last post by:
Hi all, After one of my user controls does either a server.transfer or response.redirect, the action method in a my resulting html form is being set and any request variables changed at the...
2
by: tperri | last post by:
I've got a page with a couple ascx files on it. One od the controls displays a user's picture, the other contains a datagrid where a user can upload more pictures, change their default picture,...
3
by: Jeff User | last post by:
Greeting I built asp.net (V1.1) page. I want to use this button to reset SelectedIndex=0 on several drop down lists. However, I do not want to post back to server. The point is to avoid the...
0
by: ThunderMusic | last post by:
Hi, I have a page where I have an input type=file control and many other controls... the thing is, when I cause a postback by any control on the page, if a file is selected in the input...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.