|
-
March 16th, 2009, 10:39 AM
#1
Postback processed, but event not hit
Hi
In page ( or in Control to be accurate ) i have DropDownList with
AutoPostBack set to true to postback when it is changed. I have
problem, that postback is really executed. Breakpoint in OnLoad
is hit, but event code OnSelectedIndexChanged is never hit ! I wonder
why.
Code:
<asp:DropDownList ID="cbAdults" runat="server" AutoPostBack="true" CausesValidation="false"
OnSelectedIndexChanged="InputChanged" Width="40px">
</asp:DropDownList>
Code:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
FillComboNumbers();
}
//if (Request["__EVENTTARGET"] == cbAdults.UniqueID)
// InputChanged(null, EventArgs.Empty);
}
protected void InputChanged(object sender, EventArgs e)
{
// THIS IS NEVER HIT, WHY ???
// do something
}
This happend to me several times in past and to solve it quicky,
I always had to write somethink like :
Code:
if (Page.Request["__EVENTTARGET"]==dropDown.UniqueId)
OnSelectionChanged ( dropDown, EventArgs.Empty );
This time however, I would like to know, what is real problem behind this.
I should write, that this code is inside control, but it shouldn't be the cause.
Thank you, I really have to solve this.
Martin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|