How to update a dropdown list on parent page after closing modal window
Okay, so I have an ASP page with C# code behind. I have a dropdown list
bound to a data table in SQL. I am adding a maintenance screen (modal) for
users to manage the data in the table/dropdown (add/inactivate records).
The user clicks a '+' button next to the dropdown list, the modal comes
up, they add or remove a record, and then close the modal. Upon closing
(in the 'Close:' property) I'd like to have the dropdown list on the
parent page rebind to the updated table data, preferrably without posting
back.
I'm having a tough time doing this, anyone have any suggestions?
Code behind to bind drop down to original data on parent Page_Load:
var fundingTypes = client.GetFundingTypeAll();
var onlyActiveFundingTypes = fundingTypes.FindAll(x => x.IsActive
== true);
EncryptionHelper.EncryptProperties(onlyActiveFundingTypes);
ddlFundingType.DataSource = onlyActiveFundingTypes;
ddlFundingType.DataValueField = "Id_X";
ddlFundingType.DataTextField = "Name";
ddlFundingType.DataBind();
Could this be done using a WebMethod call to the code behind to do the
rebind?
Thank you!
No comments:
Post a Comment