解决方案 »
- 我不懂VB 这行代码 麻烦帮我转成C#的 谢谢
- 我想在网站内添加一个站内短信的功能,希望哪位大虾能告诉我怎么实现??
- [求助]Repeater嵌套RadioButtonList读数据库问题
- 如何提取bookmark.htm(IE收藏夹文件)里的内容
- 请问下版主,我的问题没人答怎么结帖????
- 如何使用ASP.NET C#代码控制微软的证书颁发机构,主要想实现颁发的功能。
- ScriptManager.RegisterStartupScript传值到另一个窗口,窗口关闭不掉~~~~急急
- 关于银联在线支付接口
- 新手报道
- 难道就没有人能解决吗??????
- c# 正则表达式 请教
- easyui datagrid 删除行
function GetValueFromChild(p) {
alert(p);
}
//子窗口方法
function btnClick() {
window.opener.GetValueFromChild("Hello");
window.close();
return false;
}
1,父页面
var dialog = window.showModalDialog("child.aspx", window, "dialogWidth:0px; dialogHeight:0px; center:yes; help:no; resizable:no; status:no;");
var name=dialog;
window.location.href = window.location.href;
window.location.reload;
2,子页面
ScriptManager.RegisterStartupScript(this, this.GetType(), "auditdel", "alert('流程撤销成功!');window.close();window.returnValue = '这是要返回的name值,也可以是前台去做!';", true);
<asp:Button runat="server" ID="btn" OnClientClick="btnClick();" Text="Open" /> function btnClick() {
window.open('WebForm1.aspx');
return false;
}
//页面代码,一定要定义name属性
<input type="hidden" ID="lblInfo" name="lblInfo" />
//js代码
function GetValueFromChild(p) {
var lbl = document.getElementById('lblInfo');
lbl.value = p;
document.forms[0].submit();
}
//后台代码
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//第一次请求页面
}
else
{
if (Request["lblInfo"] != null && !string.IsNullOrEmpty(Request["lblInfo"]))
{
string str = Request["lblInfo"].ToString();
Response.Write("<script>alert('" + str + "')</script>");
}
}
}
<script> function test(name){
var lbtnSupervisor = document.getElementById("ctl00_Body_lbtnQuery_LinkButtonAction");
eval(lbtnSupervisor.href);
我如何在父窗口的后台得到这个name。
这里应该怎么写
}
</script>
<asp:LinkButton ID="lbtn" runat="server" Text="lbtn"></asp:LinkButton>
document.getElementById("label1" ).value = name;
lbl.value = p;
document.forms[0].submit();
把这三行放到你的test方法里不就行了,你要不想立刻提交就把document.forms[0].submit();删了,取值还是像我刚才那样,只能放到form_load方法里通过Request["lblInfo"]的值,如果你非要在特定的事件处理函数中处理这个值,可以在form_load里先取出来存到一个私有变量中,再到事件处理函数中处理这个变量
当出现这种错误时,不设置false,还有别的方法么?
回发或回调参数无效。在配置中使用 <pages enableEventValidation="true"/> 或在页面中使用 <%@ Page EnableEventValidation="true" %> 启用了事件验证。出于安全目的,此功能验证回发或回调事件的参数是否来源于最初呈现这些事件的服务器控件。如果数据有效并且是预期的,则使用 ClientScriptManager.RegisterForEventValidation 方法来注册回发或回调数据以进行验证。
eval(lbtnSupervisor.href.replace("''",pageNum));
我的用这种方式,我吧href里的第二个参数给替换了