I am facing an issue with updating a custom control, which includes a repeater, from a dropdownlist onchange event that executes some javascript.
The dropdownlist and updatepanel setup is as follows:-
<asp:UpdatePanel runat="server" ID="pnlPanelStageBandLetterTemplate" Visible="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList runat="server" ID="ddlBand">
<asp:ListItem Selected="True" Text="1" Value="1" />
<asp:ListItem Text="2" Value="2" />
<asp:ListItem Text="3" Value="3" />
<asp:ListItem Text="4" Value="4" />
<asp:ListItem Text="5" Value="5" />
<asp:ListItem Text="6" Value="6" />
</asp:DropDownList>
<panelStageLetters:PanelStageBandLetterTemplate id="psbltPanelStageBandLetterTemplate" runat="server">
</panelStageLetters:PanelStageBandLetterTemplate>
</ContentTemplate>
The dropdown ddlband has the following rendering:-
ddlBand.Attributes.Add("onchange", "changeCutBand('" + pnlPanelStageBandLetterTemplate.ClientID + "')");
ddlBand.ID = "ddlBand";
When a selection is made in the dropdownlist, it triggers the following code:-
function changeCutBand(panelID) {
var cbc = ($(".cutBandChanger")[0]);
val = cbc.value;
var wsid = getQueryVariable('wsid');
if (val != "0") {
$.get("changecutband.ajax?action=changecutband&newcutmethod=" + val + "&wsid=" + wsid);
var panelID = document.getElementById('ctl00_ContentPane_ctl01_pnlPanelStageBandLetterTemplate');
var ddID = document.getElementById('ctl00_ContentPane_ctl01_ddlBand');
__doPostBack(panelID, val);
}
}
This initiates an ajax call to perform a database update, which provides data for the repeater inside the custom control.
However, I am encountering an issue where though the database gets updated, the update panel does not refresh. Instead, a javascript error appears stating 'document.getelementbyid <'...'> is null or not an object with an extremely high line number.'