<script type='text/javascript'>
function ShowModelDG(ctl)
{
var obj = window.showModalDialog("../../MaterialPubliForm/MaterialPubliForm/SelectUserListTable.aspx",null,"dialogWidth:550px;dialogHeight:480px;help:no;status:no");
ctl.value=obj;
}
</script>
function ShowModelDG(ctl)
{
var obj = window.showModalDialog("../../MaterialPubliForm/MaterialPubliForm/SelectUserListTable.aspx",null,"dialogWidth:550px;dialogHeight:480px;help:no;status:no");
ctl.value=obj;
}
</script>
var strValue = window.dialogArguments;
alert(strValue)
这样行吗?
<script>
aa='liuyk';
window.showModalDialog('b.html',aa);
</script>
b.html代码如下;
<script>
var strValue = window.dialogArguments;
document.write(strValue)
</script>
运行a.html看是不是你候要的结果
function ShowModelDG(ctl)
{
var obj = window.showModalDialog("../../MaterialPubliForm/MaterialPubliForm/SelectUserListTable.aspx",this,"dialogWidth:550px;dialogHeight:480px;help:no;status:no");
ctl.value=obj;
}
</script>
URL传参数
function ShowModelDG(ctl)
{
var obj = window.showModalDialog("../../MaterialPubliForm/MaterialPubliForm/SelectUserListTable.aspx?p=xray2005",this,"dialogWidth:550px;dialogHeight:480px;help:no;status:no");
ctl.value=obj;
}
</script>
<asp:GridView ... onrowdatabound="GridView1_RowDataBound">
<Columns>
...
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl="javascript:void(0);"
Text='<%# Eval("CategoryName") %>'
>
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
HyperLink link = e.Row.FindControl("Hyperlink1") as HyperLink;
link.Attributes["onclick"] = string.Format("showModalDialog('Details.aspx?id={0}','','dialogWidth:500px;dialogHeight:500px;help:no;status:no')", GridView1.DataKeys[e.Row.RowIndex].Value);
}
}