We're using .NET 2.0, VB. I expect a .Click event handler to be called, but it's not.
When I click on the webpage link named btnSearch, the confirmSearchOK () javascipt function is called(I see this when I uncomment the alert() ), which contains the __doPostBack() call. On the .VB side, the handler never gets called. BTW, the handler was created by double-clicking on the .ASPX object in the 'Design' mode.
Any help would be appreciated.
Thanks
Javascipt:
asp.net
VB.NET event handler
When I click on the webpage link named btnSearch, the confirmSearchOK () javascipt function is called(I see this when I uncomment the alert() ), which contains the __doPostBack() call. On the .VB side, the handler never gets called. BTW, the handler was created by double-clicking on the .ASPX object in the 'Design' mode.
Any help would be appreciated.
Thanks
Javascipt:
Code:
function confirmSearchOK() {
var planSel = document.getElementById("<%= ddlPlanID.ClientID %>").selectedIndex;
var opSel = document.getElementById("<%= ddlOfferingPeriod.ClientID %>").selectedIndex;
var useEASi = document.getElementById("<%= hUseEASi.ClientID %>").value;
var epError = 0
if( useEASi == 'Y'){
if (document.getElementById("<%= ddlEnrollmentPeriod.ClientID %>").selectedIndex == 0)
epError = 1;
}
//alert("planSel: "+planSel+", opSel: "+opSel+", useEASi: "+useEASi+", epError: "+epError );
if( planSel == 0 )
alert("Error, must choose a Plan prior to Search");
else if( opSel == 0 )
alert("Error, must choose an Offering Period prior to Search");
else if( epError == 1 )
alert("Error, must choose an Enrollment Period prior to Search");
else
__doPostBack('btnSearch','');
}
Code:
<td align="left" class="FormFieldCell" colspan="3" style="white-space: nowrap"> <EASI:LinkButton ID="btnSearch" runat="server" CausesValidation="False" ClientScript="confirmSearchOK();" UseSecurityLevel="True">Search</EASI:LinkButton></td>
VB.NET event handler
Code:
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click 'handle the event here End Sub
Comment