Is it possible to popup a modal(AJAX) on drop downlist selection. I have a user control which has a ddl and another usercontrol which has that modal popup.On selection of specific item i need to popup modal. Modal popup is in another usercontrol.
A:
If I am reading you correctly, you will need to use either chained events or event bubbling to force the drop down selection to fire an event. Then your second user control must listen for that event, and fire the event that "shows" the modal popup.
Without testing code, your structure on the primary control might look like this:
public delegate void DDLHandler(int selectedValue);
public event DDLHandler DDLChanged;
public void DDLChanged(int selection)
{
if (DDLChanged != null)
{
DDLChanged(selection);
}
}
Then you drop down control has it's event wired to call the handler
protected void ddlOne_SelectedIndexChanged(object sender, EventArgs e)
{
//fire event handler for fetching value for this selection
DDLChanged(Int32.Parse(ddlMeasurementOptions.SelectedValue));
}
Ash Machine
2009-02-09 23:16:29
+2
A:
I did an example of how to do it entirely client side using a ClientEventPool - http://www.aaron-powell.com/blog/january-2009/fun-with-a-client-event-pool-and-modal-popups.aspx
For AJAX work avoid postbacks at all costs!
Slace
2009-02-10 02:33:58
This is what I was referring to, this is a better example.
brendan
2009-02-10 13:15:53
Glad to be of service
Slace
2009-02-10 22:35:29