views:

23

answers:

2

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>
A: 

please paste the html and c#/vb.net code that is not working

lakhlaniprashant.blogspot.com
please do not post your comment as an answer
Canavar
sorry, I am new to SO, I will keep this in mind, thanks
lakhlaniprashant.blogspot.com
+1  A: 

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

Juri