返回值
DialogPage.aspx:
window.returnvalue="aaa"; ParentPage.aspx:
var str=window.showModalDialog("DialogPage.aspx");
这种语句是不是要用Page.RegisterStartupScript或Page.RegisterClientScriptBlock方法来注册.
那么返回来的var如何赋值给我在ParentPage.aspx中定义的变量private string returnvalue;
DialogPage.aspx:
window.returnvalue="aaa"; ParentPage.aspx:
var str=window.showModalDialog("DialogPage.aspx");
这种语句是不是要用Page.RegisterStartupScript或Page.RegisterClientScriptBlock方法来注册.
那么返回来的var如何赋值给我在ParentPage.aspx中定义的变量private string returnvalue;
解决方案 »
- propretygrid可以编辑 但是编辑之后怎么保存呢
- 关于filter函数
- c#如何把本机某图片缩小然后另存为``麻烦给代码``谢谢
- 关于自定义转换的一个函数调用,弄不明白
- session 问题
- 各位大侠帮帮忙,急!!!!!!
- 要用button1的click事件激发gridView1的RowCellStyle事件,怎么写呀?
- 在何种情况下,使用静态方法和实例方法?
- 简单问题:winForm里dataGrid的列抬头怎么显示中文?
- c# winform listView如何修改头部颜色以及选中项时突出显示 求大神
- 如何在C#中写一个WEB的表单集合并以POST方式提交到ASP(非ASP.NET)
- 高手们,快来啊!高分求救dataGrid焦点问题??
<script language="javascript">
var str=window.showModalDialog("DialogPage.aspx");
//把返回值赋值给页面中的TextBox1
window.opener.document.getElementById("TextBox1").value = str;
</script>
或者象 xiaohuluwa(葫芦娃) 说的,用以个hidden 设置成runat="server"
<input type="hidden" id="strValue" value="aaa" runat="server">
然后再.aspx.cs定义
protected System.Web.UI.HtmlControls.HtmlInputHidden strValue;<script language="javascript">
<!--
var str = window.showModalDialog("DialogPage.aspx");
document.getElementById('strValue') = str;
-->
</script>这样就可以在.aspx.cs中对strValue值造作了.