简体   繁体   English

我在btnclick上的方法不起作用,在这里我给出了代码

[英]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? 如果在.net中将Button添加到面板中,则无法调用Button的调用方法,那么我可以做什么?

  • 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. OnOkScript属性指向一个JavaScript函数,我想您已经正确理解了,因为您在问题中提到了JavaScript。 So to achieve a postback (not ajax) you could try to do something like 因此,要实现回发(而不是ajax),您可以尝试做类似的事情

function onOk() {            
   document.getElementById('<%=ButSave.ClientID%>').click();
   return true;
}

Alternatively you have to do it asynchronously. 或者,您必须异步执行此操作。 In that situation you have two possibilities 在这种情况下,您有两种可能

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 loginpopup 的注册按钮单击时,我想显示注册弹出窗口,也想禁用登录弹出窗口,但我的代码无法正常工作,因为它应该必须 - on signup buttonclick of loginpopup I want to show signup popup and also want to disable login popup but my code is not working as it should have to 如何重定向到btnclick调用的函数中的另一个页面。 ASP.NET - how can i redirect to another page in function that called by btnclick. ASP.NET 如何在gridview中添加标题,我已经编写了代码但无法正常工作 - how to add header in gridview , i have written code but not working 我的托管网站的后端代码有问题 - I have a Problem with Backend code for my hosting website 我想通过 ASP web 页面 btnClick 在 IIS 服务器上执行.exe 文件,我正在使用 Server.MapPath - I want execute .exe file on IIS server through ASP web page btnClick, im using Server.MapPath 有人可以告诉我这里的代码有什么问题吗? - Can someone tell me what is wrong with my code here? btnclick函数调用另一个函数,但是该调用不在btnclick函数中 - A btnclick Function calls another function,but the call not in the btnclick function 如何修复我的“指定演员表无效”错误? - How can I fix my “Specified cast is not valid” error here? 我在哪里把我的错误捕获密码放在这里? - Where do I put my error trapping for password here? 在Facebook集成中,我必须访问给出访问令牌的URL,但是我在asp.net中获取了已发布的U​​RL。 - In Facebook integration I have to access the url of in which access token is given, but instead I am getting my published url in asp.net
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM