473,791 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need to clear controls while postback

3 New Member
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(nam e, 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 2519
axas
32 New Member
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 New Member
In the button click event set each control's text property to textbox1.text=" ".

Hope it will work.
Aug 3 '06 #3
dotnet
22 New Member
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
5007
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 Page Load of a main ASPX page. Now if we debug the MyTextBox, we find the order of events like so (during a Posback, of course): OnInit -> OnLoad -> LoadPostData. My question is why does the LoadPostData occur *after* the OnLoad instead of...
6
6019
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 create 1-n datagrids. When the Submit button is clicked I need to save (in viewstate) the contents of the criteria controls so that I can recreate the dynamic DataGrid(s) in the LoadViewState (overloaded method). I need to do this so that the...
3
6182
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 textbox controls, so how do you make it so that the text box value is cleared out on postback?
5
2611
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 but this triggers page validation which I do not want. What I'm trying to do is dynamically write in a hyperlink that when clicked will remove an item from the form, so I don't want any validation to occur because the form isn't being submitted at...
1
1263
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 invisible beforehand, how do you go about it ? Can you force a re-run of the control creation step ? Thanks Adrian Parker
2
1461
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 client are not being reflected upon posting. How can I get rid of this? Can I somehow programmtically clear the action method so by the time the html reaches the client, it's clear? Please help - quite urgent.
2
1101
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, etc. When a user selects a different picture in the contorl containing the datagrid, the code execute when the page postsback, but the control that displays the user's picture does not. How do I get this control to refresh on a post back?
3
1482
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 round trip. It had an asp:button which would post back to the server when clicked but changed it to an input button to avoid the postback. (If that is not needed,let me know)
0
2100
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 type=file, the file is posted... so I want to clear the file in the input on all submit except when the upload button is pressed... actually, with an alert, I can display the value of the input type=file when it should be cleared and it does not display...
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.