473,498 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Postback Confusion

The goal is to have a new web page called from a dropdown component.

HTML:
<asp:dropdownlist id="drpPacer" runat="server" ForeColor="Navy" Width
="372px" AutoPostBack="True"></asp:dropdownlist>

In the aspx.vb file, the list is bound to a command that fills the list
value with the URL to be invoked. I want it invoked whenever the
SelectedIndex property changes on the list.

Private Sub drpPacer_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles drpPacer.SelectedIndexChanged
If drpPacer.SelectedIndex <> 0 Then
Response.Redirect(RTrim(drpPacer.SelectedItem.Valu e))
End If
End Sub

The 0 item is just a placeholder.

This works fine so long as there's only one of this type dropdown list on
the page or simply one server side component with postback activity on the
page. When I add, for instance, a calendar with a SelectionChanged event
handler, the dropdown list is always the only server side component
processed; the calendar event is not processed and I'm redirected to the
correct URL. The Redirect to the selected web site is always performed no
matter if the postback was motivated by the calendar or the dropdown list
changing.

Is there someway on a postback to only process the server side component
that actually activated the post? I really don't want to resort a client
side solution. Rather stay native ASP.Net. Thanks for any help with
Postback.
Nov 18 '05 #1
1 1027
jef
Wi***********@ca8.uscourts.gov wrote:
The goal is to have a new web page called from a dropdown component.

HTML:
<asp:dropdownlist id="drpPacer" runat="server" ForeColor="Navy" Width
="372px" AutoPostBack="True"></asp:dropdownlist>

In the aspx.vb file, the list is bound to a command that fills the list
value with the URL to be invoked. I want it invoked whenever the
SelectedIndex property changes on the list.

Private Sub drpPacer_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles drpPacer.SelectedIndexChanged
If drpPacer.SelectedIndex <> 0 Then
Response.Redirect(RTrim(drpPacer.SelectedItem.Valu e))
End If
End Sub

The 0 item is just a placeholder.

This works fine so long as there's only one of this type dropdown list on
the page or simply one server side component with postback activity on the
page. When I add, for instance, a calendar with a SelectionChanged event
handler, the dropdown list is always the only server side component
processed; the calendar event is not processed and I'm redirected to the
correct URL. The Redirect to the selected web site is always performed no
matter if the postback was motivated by the calendar or the dropdown list
changing.

Is there someway on a postback to only process the server side component
that actually activated the post? I really don't want to resort a client
side solution. Rather stay native ASP.Net. Thanks for any help with
Postback.


This is strange - you're event handler shouldn't be called unless your
DropDownList is raising that specific event.

Is there any chance you could post all the code for the page?

jef
Nov 18 '05 #2

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

Similar topics

4
12677
by: Stephen | last post by:
I have the following code working in order to create an array list and populate a datagrid however everytime i click my button the first item in the array and the first row in the datagrid are...
6
2475
by: adolf garlic | last post by:
A postback I'm doing takes ages to get the data which it then uses to populate a table. What I want to know is: How can I get the client side to fire a 'resize' event when the postback thing...
1
1444
by: Christian Nunciato | last post by:
Hi there: I've checked the forums, but haven't found a situation addressing my specific problem. Here's the deal: I've got a Web Form containing two Panel controls. One displays search...
1
3069
by: John Wilson | last post by:
I am sure there is an easy answer to this, so here goes... Imagine a web form consists of two text boxes and some labels. The textboxes are given a tab order of 1 & 2, and each posts back to the...
8
1625
by: David | last post by:
I have a problem which I have worked around for some time. I would appreciate any comments on the following statements. When the enter key is pressed it causes a postback. After postback code has...
0
1191
by: jobs at webdos | last post by:
I have form with a checkbox with autopostback. When I click on the form I want to update a table with the boolean and stamp a datatime field, then come back and display *EXACTLY* what is in the db...
2
1063
by: Keithb | last post by:
A page's Page_Load event contains initialization code (shown below), intended to execute only once when the page is loaded for the first time. After page load, the first time the user clicks an...
11
14786
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
2
3897
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
0
7002
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
7165
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,...
1
6885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5462
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,...
1
4908
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...
0
4588
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...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
656
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.