62,046
社区成员
发帖
与我相关
我的任务
分享
<ItemTemplate>
<asp:LinkButton ID="LinkButton5" runat="server" ForeColor="#000066">查看</asp:LinkButton>
<asp:Label ID="Label2" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "F_cltID")%>'
Visible="False" Width="0px"></asp:Label>
</ItemTemplate>
if (e.Row.RowType == DataControlRowType.DataRow)
{
//查看
LinkButton l = (LinkButton)e.Row.FindControl("LinkButton5");
Label b = (Label)e.Row.FindControl("Label2");
int Temp1 =Convert.ToInt32( b.Text.ToString());
l.Attributes.Add("onclick", "window.showModalDialog(B窗体.aspx?id=" +Temp1 + "','window','dialogWidth:880px;DialogHeight=660px;status:no;help:no;resizable:yes;');document.execCommand('Refresh');");
}
<asp:Button ID="Button7" runat="server" Text="弹出C窗体" />
<!--PS:这个Button的作用是增加一条新记录到B窗体-->
this.Button7.Attributes.Add("onclick", "window.showModalDialog('C窗体.aspx?id=" + Server.UrlEncode(Session["XXXX"].ToString()+ "','window','dialogWidth:600px;DialogHeight=400px;status:no;help:no;resizable:yes;');document.execCommand('Refresh');");
<asp:Button ID="Button1" runat="server" Text="确 定" onclick="Button1_Click" />
<asp:Button ID="Button2" runat="server" Text="关 闭" onclick="Button2_Click" />
protected void Button1_Click(object sender, EventArgs e)
{
//增加新记录
}
protected void Button2_Click(object sender, EventArgs e)
{
//关闭
Response.Write("<script>window.close();</script>");
}
public static int QQ;//公共变量
<script type="text/javascript">
function Add1()
{
window.showModalDialog("C窗体.aspx?AnnID=<%=QQ%>","window","dialogWidth:880px;DialogHeight=500px;status:no;help:no;resizable:yes;");
window.location='#';
}
</script>
this.Button7.Attributes.Add("onclick", "window.showModalDialog('AddContractAnnal.aspx?AnnID=" + Server.UrlEncode(Session["xxx"].ToString()) + "',window,'dialogWidth:600px;DialogHeight=400px;status:no;help:no;resizable:yes;');window.location='#';");
//关闭
protected void Button2_Click(object sender, EventArgs e)
{
Response.Write("<script>window.dialogArguments.location.reload();</script>");
Response.Write("<script>window.close();</script>");
}