My Mehod on btnclick is not working, here i have given the code
Cant call method of Button if Button is added to panel in the .net so wt can i do?
- my code
Add Category
</asp:Panel>
<asp:Label ID="LblMsg" runat="server"></asp:Label>
<cc1:ModalPopupExtender ID="LnkBtnAddCategory_ModalPopupExtender" runat="server"
TargetControlID="LnkBtnAddCategory"
PopupControlID ="ModelPanel1"
OkControlID="BtnOKModel"
OnOkScript="onOK()"
开发者_如何学运维 CancelControlID="BtnCancelModel"
DropShadow="true"
BackgroundCssClass="modalBackground"
>
</cc1:ModalPopupExtender>
It is still quite difficult to really understand the origin of your problem or what exactly you'd like to achieve.
The OnOkScript
property points to a JavaScript function which I suppose you understood correctly since you're mentioning JavaScript in your question post. So to achieve a postback (not ajax) you could try to do something like
function onOk() {
document.getElementById('<%=ButSave.ClientID%>').click();
return true;
}
Alternatively you have to do it asynchronously. In that situation you have two possibilities
- Page methods
- Web services
精彩评论