需要用一个简单的ASP.NET ModalPopupExtender的例子​​帮助 [英] Need help with a simple ASP.NET ModalPopupExtender example

查看:124
本文介绍了需要用一个简单的ASP.NET ModalPopupExtender的例子​​帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的ASP.NET和我试图让这个Ajax的ModalPopupExtender工作。这是一个例子,我发现在网络上,但btnpopup被点击时没有任何反应。

 <%@页面语言=C#AutoEventWireup =真正的codeBehind =Default.aspx.cs继承=ModalTestProject._Default%>

!< D​​OCTYPE HTML PUBLIC -  // W3C // DTD XHTML 1.0过渡// ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

< HTML的xmlns =htt​​p://www.w3.org/1999/xhtml>
<头=服务器>
    <冠军>无标题页< /标题>
< /头>
<身体GT;

<表格ID =Form1的=服务器>

< ASP:ScriptManager的ID =ScriptManager1=服务器>
< / ASP:ScriptManager的>

< ASP:按钮的ID =btnpopup=服务器文本=按钮/>

< ajaxToolkit:ModalPopupExtender ID =MPE=服务器的TargetControlID =btnpopupPopupControlID =pnlpopup
    CancelControlID =btnCancelpopup的EnableViewState =真正的阴影效果=真/>

< ASP:面板ID =pnlpopup=服务器WIDTH =400像素>
    测试
    < ASP:按钮的ID =btnCancelpopup=服务器文本=按钮/>
< / ASP:面板>

< /形式GT;

    < /身体GT;
< / HTML>
 

解决方案

您缺少 PopupControlID =pnlpopup

I'm new to ASP.NET and I'm trying to get this Ajax ModalPopupExtender working. This is an example i found on the net, but nothing happens when btnpopup is clicked.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ModalTestProject._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>

<form id="form1" runat="server">

<asp:scriptmanager id="ScriptManager1" runat="server">
</asp:scriptmanager>

<asp:Button ID="btnpopup" runat="server" Text="Button" /> 

<ajaxToolkit:ModalPopupExtender ID="mpe" runat="server" TargetControlID="btnpopup" PopupControlID="pnlpopup" 
    CancelControlID="btnCancelpopup" EnableViewState="true" DropShadow="true" />

<asp:Panel ID="pnlpopup" runat="server" Width="400px">
    test
    <asp:Button ID="btnCancelpopup" runat="server" Text="Button" />
</asp:Panel>

</form>

    </body>
</html>

解决方案

You are missing the PopupControlID="pnlpopup"

这篇关于需要用一个简单的ASP.NET ModalPopupExtender的例子​​帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆