我正在尝试从网格视图中显示弹出窗口。但是当我尝试在网站上运行以下代码时,弹出式面板不可见。但是当我删除面板的样式(即display = none;)时,它只是显示为面板而不是弹出窗口。在按钮中单击网格视图中的链接按钮,我试图显示一个弹出窗口。帮帮我...
<asp:UpdatePanel runat="server" ID="up1">
<ContentTemplate>
<asp:GridView ID="minidata" CssClass="table" runat="server" AutoGenerateColumns="false" DataKeyNames="abstract">
<Columns>
<asp:BoundField DataField="pid" HeaderText="MyFileId" />
<asp:BoundField DataField="video" HeaderText="MyFileurl" />
<asp:TemplateField HeaderText="abstract">
<ItemTemplate>
<asp:LinkButton ID="lnkDownload" runat="server" Text="Download" OnClick="lnkDownload_Click"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:Panel runat="server" ID="panel1" Height="200px" Width="300px" BorderStyle="Solid" BorderWidth="2px" style="display:none;">
<div>
<table>
<tr>
<td>
<asp:Label runat="server" Text="sacca"></asp:Label>
</td>
<td>
<asp:TextBox ID="emails" runat="server"></asp:TextBox>
</td>
<td>
<asp:LinkButton runat="server">5e76d</asp:LinkButton>
</td>
</tr>
</table>
</div>
</asp:Panel>
<asp:ModalPopupExtender ID="ModalPopupExtender1" PopupControlID="panel1" TargetControlID="Button1" runat="server"></asp:ModalPopupExtender>
<asp:Button ID="Button1" Style="display: none;" runat="server" Text="Button" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="minidata" />
</Triggers>
</asp:UpdatePanel>
在.cs文件中
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = minidata.DataKeys[gvrow.RowIndex].Value.ToString();
HiddenField1.Value = filePath;
emails.Text = "myemail";
this.ModalPopupExtender1.Show();
当我检查网站时,我找不到页面中显示的面板
答案 0 :(得分:1)
因此,请尝试通过替换此
来实现func execCmd(name string, args ...string) {
cmd := exec.Command(name, args...)
fmt.Printf("Command is: %s, %s", name, args)
out, err := cmd.Output()
fmt.Printf("OutVar: %s\n", out)
fmt.Printf("ErrVar: %s\n", err)
}
与
<asp:LinkButton ID="lnkDownload" runat="server" Text="Download" OnClick="lnkDownload_Click"></asp:LinkButton>
您的服务器端代码对此方法无用
好的,你的应用程序中没有JQuery ^^。
您可以在应用中添加JQuery,还是约束?
如果是,等待我发现你是一个原生的JavScript代码,试着把它包括在内
<asp:LinkButton ID="lnkDownload" runat="server" Text="Download" onclick="$('[id$=Button1]').click()"></asp:LinkButton>