请有人帮助我..我收到错误“找不到ajax模式弹出扩展程序的源代码”。我在网上搜索,我发现这个问题有不同的解决方案。我尝试了所有这些,但找不到我的解决方案!!
我在项目中添加了ajax控件工具4.0套件,我的vs是2010。
我的页面:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserDetails.aspx.cs" Inherits="UserDetails" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
.
.
.
.
<form id="form1" runat="server">
<ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</ajax:ToolkitScriptManager>
<div align="center">
<h3 style="color: Olive" align="center" >
User Details
.
.
.
.
</table>
<asp:LinkButton ID="lnk" Text="" runat="server"></asp:LinkButton>
<ajax:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lnk" CancelControlID="btnClose" PopupControlID="pnlPop">
</ajax:ModalPopupExtender>
<asp:Panel ID="pnlPop" runat="server" Visible="false">
<div>
Display
</div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tr
.....
<asp:Button ID="btnClose" runat="server" Text="Close" CssClass="button" />
在我的代码背后:
protected void gdView_SelectedIndexChanged(object sender, EventArgs e)
{
lbName.Text = gdView.SelectedRow.Cells[0].Text;
ModalPopupExtender1.Show();
}
答案 0 :(得分:0)
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div align="center" style="z-index: 10000">
<asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
<asp:Panel ID="pnlPop" runat="server" Style="display: none;>
<div>
Display
</div>
</asp:Panel>
<ajax:ModalPopupExtender runat="server" ID="ModalPopupExtender1" TargetControlID="btnShowPopup"
BackgroundCssClass="modalBackground" PopupControlID="pnlPop" />
</div>
代码背后:
protected void gdView_SelectedIndexChanged(object sender, EventArgs e)
{
lbName.Text = gdView.SelectedRow.Cells[0].Text;
ModalPopupExtender1.Show();
}
答案 1 :(得分:0)
我发现了我的错!它只是面板可见性被设置为假!!如果我将可见设置为假,则无法找到它!