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

Textboxes and autopostbacks


Hi

On my webform I have a textbox in which autopostback is set to true. (nb
I don’t want to disable this because I have manipulating the visibility
of other controls, but for the purposes of the exercise I’ve stripped
that code out for the time being).

What’s happening

a) If I click the submit button on the web form then the submit buttons
click event is triggered [which is good].

If I click on the textbox set to autopostback, then click on another
textbox not set to autopostback, the submit buttons click event is
triggered [which still is good].

However….
If I click on the textbox set to autopostback, and then immediately
click the submit button, then that buttons click event is not triggered
[which is bad]. I have to press the submit button again to trigger the
click event. It’s as if there are two postback events which are being
queued here.

Any ideas on how to solve this (I’m using asp.net/vb)?

Many Thanks

Alex

p.s.
I appear to be posting every day here. Sorry about this, I’m pretty new
to these “complex” forms. I’m RTFM’ing the manual but still getting
nowhere sometimes.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
2 3266
Alex,

Here's what I would do.

Instead of using the text box's autopost back feature, which submits the
form, I would attach a javascript to the textbox that clicks the button
instead. It would look like this:

MyTextBox.Attributes.Add("onChange", "javascript:document.Form1." &
MyButton.ClientID & ".click();")

I think that will solve your problem.
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Alex Shirley" <po******@alexshirley.com> wrote in message
news:eg*************@tk2msftngp13.phx.gbl...

Hi

On my webform I have a textbox in which autopostback is set to true. (nb
I don't want to disable this because I have manipulating the visibility
of other controls, but for the purposes of the exercise I've stripped
that code out for the time being).

What's happening

a) If I click the submit button on the web form then the submit buttons
click event is triggered [which is good].

If I click on the textbox set to autopostback, then click on another
textbox not set to autopostback, the submit buttons click event is
triggered [which still is good].

However..
If I click on the textbox set to autopostback, and then immediately
click the submit button, then that buttons click event is not triggered
[which is bad]. I have to press the submit button again to trigger the
click event. It's as if there are two postback events which are being
queued here.

Any ideas on how to solve this (I'm using asp.net/vb)?

Many Thanks

Alex

p.s.
I appear to be posting every day here. Sorry about this, I'm pretty new
to these "complex" forms. I'm RTFM'ing the manual but still getting
nowhere sometimes.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2
there are two postbacks happening

1) click on textbox - browser start postback
2) click on submit before postback response, browser will post again.
if you are fast clicking on the submit, you can get server postbacks going
at once. the browser will ignore all but the last, but the server will fully
process all of them.
-- bruce (sqlwork.com)

"Alex Shirley" <po******@alexshirley.com> wrote in message
news:eg*************@tk2msftngp13.phx.gbl...

Hi

On my webform I have a textbox in which autopostback is set to true. (nb
I don't want to disable this because I have manipulating the visibility
of other controls, but for the purposes of the exercise I've stripped
that code out for the time being).

What's happening

a) If I click the submit button on the web form then the submit buttons
click event is triggered [which is good].

If I click on the textbox set to autopostback, then click on another
textbox not set to autopostback, the submit buttons click event is
triggered [which still is good].

However..
If I click on the textbox set to autopostback, and then immediately
click the submit button, then that buttons click event is not triggered
[which is bad]. I have to press the submit button again to trigger the
click event. It's as if there are two postback events which are being
queued here.

Any ideas on how to solve this (I'm using asp.net/vb)?

Many Thanks

Alex

p.s.
I appear to be posting every day here. Sorry about this, I'm pretty new
to these "complex" forms. I'm RTFM'ing the manual but still getting
nowhere sometimes.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #3

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

Similar topics

4
by: T. Wintershoven | last post by:
Hello, I have a few textboxes placed on a SSTab control devided over 3 tabs Is there a way to clear all textboxes in one time in stead of one by one. Someone told me "Use for each item...
7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
1
by: Edlueze | last post by:
I have a number of forms with large textboxes for the purposes of editing memo fields, and just recently I've noticed some bizarre behavior. For some textboxes the END and HOME keys do nothing,...
11
by: ian.davies52 | last post by:
Is there anything I can do about the apparent limit on the number of textboxes that have calculations as their control source on a form or report in ms-access? I have a query that pulls together...
4
by: Jason M | last post by:
Hi, Im very new to c#, so forgive me if this is a really stupid question. Im trying to create a form for entering purchase requests. For each line item I have a quantity, a description unit cost...
1
by: Newbie | last post by:
hello, i have a 14 textboxes and 14 requiredfieldvalidator controls to validate the textboxes. if one or more of the textboxes is empty, the corresponding requiredfieldvalidator controls show...
0
by: Drew | last post by:
Hey, i am currently looking for a nice solution for the following problem ( i could not find a sufficient solution in the other postings ): I am having several textboxes on my page, some of them...
1
by: amurra06 | last post by:
I have a form that contains a tabpage and in that tabpage is a usercontrol that conatins a bunch of textboxes. I have arranged these textboxes in groupboxes to organize them better. What I do is to...
8
by: clintonG | last post by:
I have to get to this later tonight or tommorrow...and wonder... There's two TextBoxes in a Wizard Step posing an either-or situtation. Only one or the other TextBox may pass data. The...
3
by: sakhan | last post by:
Hello Friends, I want to create a row of 10 textboxes each time I click the add button. I want this to continue till it reaches five hundred I am using AJAX for this. It doesnot create 10...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.