| Trevor Grant 2004-05-30, 10:45 am |
| Hi Scott
It also does not work if you took the DropDownList out of
the User control and placed it directly into the Template
File.
There is a postback. But the event handler is not getting
called.
And here's when it gets really weird: I removed
AutoPostBack=true from the DropDownList and the event
handler was called...strange.
Trevor
>-----Original Message-----
>I have a simple User Control I would like to capture on a
post back.
>
><asp:DropDownList id="ddl" runat="server"
autopostback="true">
> <asp:ListItem value=" />
> <asp:ListItem value="myValue">my value</asp:ListItem>
></asp:DropDownList>
>
>Then in the code behind of the ascx
>
>protected DropDownList ddl
>
>Inside OnInit()
>ddl.SelectedIndexChanged += new
>System.EventHandler(ddl_SelectedIndexChanged)
>
>then
>private void ddl_SelectedIndexChanged(object s, EventArgs
e)
>{ string value = ddl.SelectedValue; }
>
>
>and the post back is not firing the event.
>
>I know this code is correct (what I just typed isn't the
code, it's free
>hand, but still should be correct barring typos) to fire
the event, but
>somehow CMS is interfering.
>
>Thanks for the help......
>
>
>.
>
|