473,509 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help: Events not executing

Hi Everyone,
I'm having a problem trying to get the program to execute the
SelectedIndexChanged event for a Dropdownlist (Combobox). I double clicked
the control to get the event in the Code-Behind file. I have the following
declare :
Protected Sub cmbPORequests_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles cmbPORequests.SelectedIndexChanged
if cmbPORequests.SelectedValue > 0 then
BindGrid(cmbPORequests.SelectedValue )
end if
End Sub

When I select a new item in the control, the event is not executed. I even
tried to add the following to the markup:
<asp:DropDownList ID="cmbPORequests" runat="server" DataTextField=""
OnSelectedIndexChanged="cmbPORequests_SelectedInde xChanged"
DataValueField="" Style="left: 298px; top: 109px" Width="175px">
</asp:DropDownList>
This didn't work either. One question I did have was: Do I need to set the
AutoPostBack property to true? From my reading I get the feeling I don't need
to, but wanted to make sure. Any comments would help. Thanks.
Michael

Apr 12 '06 #1
8 845
Hi Everyone,
I've done some testing and have found that if I have AutoPostBack set to
true, I get the event, BUT ONLY AFTER I click a command button. It seems that
it has put the events in a queue. If I turn off AutoPostback, the event for
the combo is never executed. I need the form to respond right away to the
SelectedIndexChanged event so that it can load the correct data in a grid.
Thanks for any advice.
Michael

Apr 12 '06 #2
AutoPostBack works if javascript is working in the page. If not, then the
form has to wait until the user has hit the submit button.

-Brock
http://staff.develop.com/ballen

Hi Everyone,
I've done some testing and have found that if I have AutoPostBack set
to
true, I get the event, BUT ONLY AFTER I click a command button. It
seems that
it has put the events in a queue. If I turn off AutoPostback, the
event for
the combo is never executed. I need the form to respond right away to
the
SelectedIndexChanged event so that it can load the correct data in a
grid.
Thanks for any advice.
Michael

Apr 12 '06 #3
Hi Brock,
Thanks for the reply. I'm not sure if I got all the setting right, but I
went into the Intoernet options > Security
I enabled "Allow scripting of Internet Explorer Webbrowser controls"
Already enabled "Scripting of Java applets"
Java permissions = High safty (Does this one need to be changed)

I made sure of the above settings and ran the project, and it didn't work
again, at least not when the I select an item from the dropdownlist. Only
after clicking on one of commad buttons. What do you think. Thanks again so
much for the reply.
Michael

"Brock Allen" wrote:
AutoPostBack works if javascript is working in the page. If not, then the
form has to wait until the user has hit the submit button.

-Brock
http://staff.develop.com/ballen


Apr 12 '06 #4
What happens if you create a new blank page, drop a server dropdownlist on
it, double-click on it to get to the code behind, and put in some code for
the selectedindexchanged event. Does this work?

"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
Hi Everyone,
I'm having a problem trying to get the program to execute the
SelectedIndexChanged event for a Dropdownlist (Combobox). I double clicked
the control to get the event in the Code-Behind file. I have the following
declare :
Protected Sub cmbPORequests_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles cmbPORequests.SelectedIndexChanged
if cmbPORequests.SelectedValue > 0 then
BindGrid(cmbPORequests.SelectedValue )
end if
End Sub

When I select a new item in the control, the event is not executed. I even
tried to add the following to the markup:
<asp:DropDownList ID="cmbPORequests" runat="server" DataTextField=""
OnSelectedIndexChanged="cmbPORequests_SelectedInde xChanged"
DataValueField="" Style="left: 298px; top: 109px"
Width="175px">
</asp:DropDownList>
This didn't work either. One question I did have was: Do I need to set the
AutoPostBack property to true? From my reading I get the feeling I don't
need
to, but wanted to make sure. Any comments would help. Thanks.
Michael

Apr 12 '06 #5
Hi Jeff,
I created a new project, added a master page and a content page and on the
content page I added a dropdownlist. For the SelectedIndexChanged event I
just added a msgbox call. It works with the AutoPostback set to true. What
does this you. Is there something in the web.config file that may need to be
changed? Thanks again for the help.
Michael
"Jeff Dillon" wrote:
What happens if you create a new blank page, drop a server dropdownlist on
it, double-click on it to get to the code behind, and put in some code for
the selectedindexchanged event. Does this work?

"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
Hi Everyone,
I'm having a problem trying to get the program to execute the
SelectedIndexChanged event for a Dropdownlist (Combobox). I double clicked
the control to get the event in the Code-Behind file. I have the following
declare :
Protected Sub cmbPORequests_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles cmbPORequests.SelectedIndexChanged
if cmbPORequests.SelectedValue > 0 then
BindGrid(cmbPORequests.SelectedValue )
end if
End Sub

When I select a new item in the control, the event is not executed. I even
tried to add the following to the markup:
<asp:DropDownList ID="cmbPORequests" runat="server" DataTextField=""
OnSelectedIndexChanged="cmbPORequests_SelectedInde xChanged"
DataValueField="" Style="left: 298px; top: 109px"
Width="175px">
</asp:DropDownList>
This didn't work either. One question I did have was: Do I need to set the
AutoPostBack property to true? From my reading I get the feeling I don't
need
to, but wanted to make sure. Any comments would help. Thanks.
Michael


Apr 12 '06 #6
By the way, I'm using Visual Studio 2005 if that makes a difference.
Michael
"Jeff Dillon" wrote:
What happens if you create a new blank page, drop a server dropdownlist on
it, double-click on it to get to the code behind, and put in some code for
the selectedindexchanged event. Does this work?

"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
Hi Everyone,
I'm having a problem trying to get the program to execute the
SelectedIndexChanged event for a Dropdownlist (Combobox). I double clicked
the control to get the event in the Code-Behind file. I have the following
declare :
Protected Sub cmbPORequests_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles cmbPORequests.SelectedIndexChanged
if cmbPORequests.SelectedValue > 0 then
BindGrid(cmbPORequests.SelectedValue )
end if
End Sub

When I select a new item in the control, the event is not executed. I even
tried to add the following to the markup:
<asp:DropDownList ID="cmbPORequests" runat="server" DataTextField=""
OnSelectedIndexChanged="cmbPORequests_SelectedInde xChanged"
DataValueField="" Style="left: 298px; top: 109px"
Width="175px">
</asp:DropDownList>
This didn't work either. One question I did have was: Do I need to set the
AutoPostBack property to true? From my reading I get the feeling I don't
need
to, but wanted to make sure. Any comments would help. Thanks.
Michael


Apr 12 '06 #7
Thanks for the help. I have it working now. Installing java may have
corrected something. Its working great now. Thanks for all that helped.
Michael

"Jeff Dillon" wrote:
What happens if you create a new blank page, drop a server dropdownlist on
it, double-click on it to get to the code behind, and put in some code for
the selectedindexchanged event. Does this work?

"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
Hi Everyone,
I'm having a problem trying to get the program to execute the
SelectedIndexChanged event for a Dropdownlist (Combobox). I double clicked
the control to get the event in the Code-Behind file. I have the following
declare :
Protected Sub cmbPORequests_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles cmbPORequests.SelectedIndexChanged
if cmbPORequests.SelectedValue > 0 then
BindGrid(cmbPORequests.SelectedValue )
end if
End Sub

When I select a new item in the control, the event is not executed. I even
tried to add the following to the markup:
<asp:DropDownList ID="cmbPORequests" runat="server" DataTextField=""
OnSelectedIndexChanged="cmbPORequests_SelectedInde xChanged"
DataValueField="" Style="left: 298px; top: 109px"
Width="175px">
</asp:DropDownList>
This didn't work either. One question I did have was: Do I need to set the
AutoPostBack property to true? From my reading I get the feeling I don't
need
to, but wanted to make sure. Any comments would help. Thanks.
Michael


Apr 12 '06 #8
I'm confused. Is it working, or not?

When I do this, I don't have to set anything..it just works. And keep in
mind you can't call MsgBox, it runs on the server!

Jeff

"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
Hi Jeff,
I created a new project, added a master page and a content page and on the
content page I added a dropdownlist. For the SelectedIndexChanged event I
just added a msgbox call. It works with the AutoPostback set to true. What
does this you. Is there something in the web.config file that may need to
be
changed? Thanks again for the help.
Michael
"Jeff Dillon" wrote:
What happens if you create a new blank page, drop a server dropdownlist
on
it, double-click on it to get to the code behind, and put in some code
for
the selectedindexchanged event. Does this work?

"Michael" <Mi*****@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
> Hi Everyone,
> I'm having a problem trying to get the program to execute the
> SelectedIndexChanged event for a Dropdownlist (Combobox). I double
> clicked
> the control to get the event in the Code-Behind file. I have the
> following
> declare :
> Protected Sub cmbPORequests_SelectedIndexChanged(ByVal sender As
> Object,
> ByVal e As System.EventArgs) Handles cmbPORequests.SelectedIndexChanged
> if cmbPORequests.SelectedValue > 0 then
> BindGrid(cmbPORequests.SelectedValue )
> end if
> End Sub
>
> When I select a new item in the control, the event is not executed. I
> even
> tried to add the following to the markup:
> <asp:DropDownList ID="cmbPORequests" runat="server" DataTextField=""
> OnSelectedIndexChanged="cmbPORequests_SelectedInde xChanged"
> DataValueField="" Style="left: 298px; top: 109px"
> Width="175px">
> </asp:DropDownList>
> This didn't work either. One question I did have was: Do I need to set
> the
> AutoPostBack property to true? From my reading I get the feeling I
> don't
> need
> to, but wanted to make sure. Any comments would help. Thanks.
> Michael
>


Apr 12 '06 #9

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

Similar topics

16
2872
by: anonymous.user0 | last post by:
The way I understand it, if I have an object Listener that has registered as a listener for some event Event that's produced by an object Emitter, as long as Emitter is still allocated Listener...
15
2595
by: Bryce K. Nielsen | last post by:
I have an object that starts a thread to do a "process". One of the steps inside this thread launches 12 other threads via a Delegate.BeginInvoke to process. After these 12 threads are launched,...
5
2747
by: Daniel | last post by:
Hey guys When you hook an event (c# 2.0 syntax): myEvent += MyMethodToFire; You need to also unsubscribe it to avoid a resource leak so that the object it is in gets garbage collected like so...
0
5519
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
11
3220
by: MikeT | last post by:
This may sound very elementary, but can you trap when your object is set to null within the object? I have created a class that registers an event from an object passed in the constructor. When...
0
7233
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
7135
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
7342
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
7410
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...
1
7067
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
5650
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
5060
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
3215
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
3201
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.