Ask a Question related to ASP.NET Building Controls, Design and Development.
-
BentleyInc #1
SelectedIndexChanged event is not fired
I've created a Web user control that contains a DropDownList and this
DropDownList gets created and loaded in init() everytime. I set
AutoPostBack=true and registered the event.
I'm using the same user control at 2 different places. When running in the
ASP.NET web form, the DropDownList is working fine and the
SelectedIndexChanged event handler does get called, but when running the
same user control in my Sharepoint Web part page, the event never gets
fired.
Has anyone out there had similar problem (not necessarily to be Sharepoint
related) that SelectedIndexChanged is not firing? Any possible reasons? It
definitely does a post back just the event is not firing.
Thanks in advance.
Jingmei Li
Bentley Systems Inc.
BentleyInc Guest
-
cannot trigger SelectedIndexChanged event
I use data binding function to display data from DB to datagrid. but I don't know why I cannot trigger the SelectedIndexChanged event? -
SelectedIndexChanged event not firing
Is the AutoPostBack property of the DropDown set to True? -- HTH, Kevin Spencer Microsoft MVP ..Net Developer http://www.takempis.com... -
SelectedIndexChanged event in DropDownList
Hi. Why cannot I capture the SelectedIndexChanged event from a DropDownList when the viewstate is set to false (it must be set to false because of... -
add Javascript code at the end of a SelectedIndexChanged event
I have a webform that searches a database and displays the output in a datagrid. I would like to be able to call a javascript at the end of the... -
Dropdownlist SelectedIndexChanged event problem
I am trying to get the newly selected item in the dropdownlist control from the SelectedIndexChanged event. The event is working fine, but I am... -
Henri #2
Re: SelectedIndexChanged event is not fired
Please provide your code.
Difficult to help without it.
Henri
"BentleyInc" <BentleyInc@online.nospam> a écrit dans le message de
news:%23VsfS4u3EHA.208@TK2MSFTNGP12.phx.gbl...> I've created a Web user control that contains a DropDownList and this
> DropDownList gets created and loaded in init() everytime. I set
> AutoPostBack=true and registered the event.
>
> I'm using the same user control at 2 different places. When running in the
> ASP.NET web form, the DropDownList is working fine and the
> SelectedIndexChanged event handler does get called, but when running the
> same user control in my Sharepoint Web part page, the event never gets
> fired.
>
> Has anyone out there had similar problem (not necessarily to be Sharepoint
> related) that SelectedIndexChanged is not firing? Any possible reasons? It
> definitely does a post back just the event is not firing.
>
> Thanks in advance.
>
> Jingmei Li
> Bentley Systems Inc.
>
>
>
>
Henri Guest
-
ComSpex #3
RE: SelectedIndexChanged event is not fired
My guess is it may be a kind of name conflict -- same id is used somewhere.
"BentleyInc" wrote:
> I've created a Web user control that contains a DropDownList and this
> DropDownList gets created and loaded in init() everytime. I set
> AutoPostBack=true and registered the event.
>
> I'm using the same user control at 2 different places. When running in the
> ASP.NET web form, the DropDownList is working fine and the
> SelectedIndexChanged event handler does get called, but when running the
> same user control in my Sharepoint Web part page, the event never gets
> fired.
>
> Has anyone out there had similar problem (not necessarily to be Sharepoint
> related) that SelectedIndexChanged is not firing? Any possible reasons? It
> definitely does a post back just the event is not firing.
>
> Thanks in advance.
>
> Jingmei Li
> Bentley Systems Inc.
>
>
>
>ComSpex Guest
-
Unregistered #4
Re: SelectedIndexChanged event is not fired
How I do it:
1. Put the control on the ascx
<asp:DropDownList runat="server" ID="DrpNiveau"></asp:DropDownList>
2. Declare the control in the usercontrol class (Not as new! it already exsists) Use the Id above exactly as the name in the declaration
protected DropDownList DrpNiveau;
3. Add the event to the OnInit
Set the Autopostback of the control to true
protected override void OnInit(EventArgs e)
{
DrpNiveau.SelectedIndexChanged += DrpNiveau_SelectedIndexChanged;
DrpNiveau.AutoPostBack = true;
}
4. Add the event to the class:
protected void DrpNiveau_SelectedIndexChanged(object sender, EventArgs e)
{
}Unregistered Guest



Reply With Quote

