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

A webform problem.

I have a difficult scenario here. Previously I have tried to post something
similar here, unfortunately I got no solution.
For simplicity I have created something simple to simulate my problem.
I have a simple webform that goes,
________________
dropdownlist --> |_____________|V| [label3]
______________
text box 1 ---> |______________| [label1]
______________
text box 2 ----> |_____________| [label2]
___________________
|UpdateLabelAndLabel2|

A DropDownList With A Label "Label3" beside it
2 textboxes with Labels 1 and 2 beside them respectively
A UpdateLabel1AndLabel2 Button

The dropdownlist has a few predefined options and 'AutoPostBack="True" '
The TextBox1 has ' OnTextChanged="HandleTextBox1Event" AutoPostBack="False" '
TextBox2 has ' OnTextChanged="HandleTextBox2Event" AutoPostBack="False" '
The Button submits the form

the event handlers are as follows:
Private Sub DropDownList_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles

DropDownList.SelectedIndexChanged

Label3.Text = sender.SelectedValue

End Sub

Public Sub HandleTextBox1Event(ByVal Sender As Object, ByVal e As EventArgs)

Label1.Text = Sender.text

End Sub

Public Sub HandleTextBox2Event(ByVal Sender As Object, ByVal e As EventArgs)

Label2.Text = Sender.text

End Sub

When I make changes to the text in the textboxes and click the button, the
event handlers handling the TextChanged event would update the labels' text.
This is ok. but when I make changes to the text in the textboxes and then
select a value in the dropdownlist instead of clicking the button, the
TextChanged events fired as well, as a result of the postback caused by the
dropdownlist's SelectedIndexChanged event. so the question here is, I need
the dropdownlist to postback so that i can get its selected value but i dont
want the textboxes' TextChanged events to affect the labels as a result of
the postback caused by the dropdownlist instead of the button.
i need to use textchanged event handlers in my webform because the original
problem lies with mass editing of rows in a repeater with textboxes and
checkboxes. Help will be much appreciated.

Regards,
Solitus

Nov 19 '05 #1
0 989

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Stephen | last post by:
Hey everyone. I was wondering if someone could help me with a small problem. I have designed a user control and I would have inserted it on a aspz page (WebForm1). The User control is being used to...
0
by: Bita-kookoo | last post by:
I am having a problem with inheritance for my web solution. Here are the steps I took for a project within C#: -I first created a new class, descended from System.Web.UI.Page. For this...
1
by: hqdtech | last post by:
how to refresh webform from other webform I have 2 webform, i want if webform A was close then webform B wil refresh. And the problem second: how to catch packet on the network in C#. ...
4
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). ...
2
by: Rob | last post by:
I have a webform that uses the TabStrip and MultiPage webcontrols. I also have a Print button on the form to print all of the information of the webform (all tabs): <input type="button"...
5
by: James Radke | last post by:
Hello, I am using VB.NET to call an unmanaged DLL which contains some functions. When I call the DLL from a windows application, it all works fine. When I place the same code in a webform...
0
by: Dew Baboeram | last post by:
Hi all, I have this curious problem with a stylesheet and a webform. I have a class defined in the stylesheet with fontsize, background colcor etc. The webform uses the stylesheet with the...
1
by: Rocky | last post by:
I have a problem. I have a webform, which uses impersonation. My iis is set to windows integrated authentication and anonymous is disabled. My webform connects to active directory and...
5
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have start web form and when the user clicks a button (server.transfer) they are directed to the second webform. I was wondering if there is a way to create an instance of the first webform...
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: 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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
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,...
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...
0
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...

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.