English 中文(简体)
之后的Click代码在设定为ModalPopupExtender TargetControlID时没有执行。
原标题:Link OnClick code behind does not execute when set as ModalPopupExtender TargetControlID

我进行了大量搜查,无法说明这一点。

我有一个ModalPopupExtender popup,我想在用户点击DoSomething链接时显示这一点。 登峰后控制着下降,在使用者要求开始对话时,我就希望散落。 这需要通过后面的编码使服务器站起来。 目前,我正试图通过有关该链接的“OnClick”活动来做到这一点,但一旦该链接与ModalPopupExtender连接起来,“OnClick”代码就没有执行。

www.un.org/spanish/ecosoc 《刑法》:

<asp:LinkButton ID="lnkDoSomething" runat="server" onClick="lnkDoSomething_Click">Do Something</asp:LinkButton>
<asp:ModalPopupExtender ID="mpelnklnkDoSomething" runat="server" BackgroundCssClass="modalBackground"
    DropShadow="true" PopupControlID="lnkDoSomething"
    PopupDragHandleControlID="pnlDragHandlerForlnkDoSomething"   
    TargetControlID="lnklnkDoSomething"></asp:ModalPopupExtender>

当我确定ModalPopupretender与OnClick代码没有执行的联系时,问题就立即解决。 这显然是设计的,但它对我(原)没有意义,因为如果使用者点击“OnClick”代码之间的联系,就应当执行。

为什么得不到支持,正确的解决办法是什么?

最佳回答

Attach the ModalPopupExtender to a dummy button and show the Format on the LinkButton s 甚至从法典背后:

http://www.ohchr.org。

<asp:LinkButton ID="lnkDoSomething" runat="server" onClick="lnkDoSomething_Click">Do Something</asp:LinkButton>
<asp:Button id="dummyButton" runat="server" style="display:none;" />

<asp:ModalPopupExtender ID="mpelnklnkDoSomething" runat="server" 
  BackgroundCssClass="modalBackground" DropShadow="true" PopupControlID="controlToPopUpId"
  PopupDragHandleControlID="pnlDragHandlerForlnkDoSomething" 
  TargetControlID="dummyButton"></asp:ModalPopupExtender>

<>斯特凡>

  protected void lnkDoSomething_Click(Object sender, EventArgs e) 
  {
     //do work
     mpelnklnkDoSomething.Show();
  }
问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!