如何在asp.net的新窗口中打开页面 [英] How to open a page in new window in asp.net

查看:86
本文介绍了如何在asp.net的新窗口中打开页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,



当我点击按钮时,我想在新窗口中打开一个asp页面。并通过使用查询字符串传递一个值.Plz先生为我解决这个小问题...

Dear sir,

I want to open an asp page in new window when I click on a button. and pass a value through it by using query string.Plz sir solve this small problem for me...

推荐答案

你需要我们做什么?



所有你必须做的事情新窗口中的ASP.NET打开页面 [ ^ ]进入谷歌并做一点阅读。
What do you need us for?

All you had to do what type "ASP.NET open page in new window[^]" into Google and do a little reading.


试试这个,把这一行放在你的按钮点击事件

try this,put the line in ur button click event
ScriptManager.RegisterClientScriptBlock(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)-(700/2);window.open( 'MyPage.aspx?recepitno=" + ID + "', null, 'height=600,width=650,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top=\'+Mtop+\', left=\'+Mleft+\'' );", true);


protected void btnNewEntry_Click(object sender, EventArgs e)
{
   Page.ClientScript.RegisterStartupScript(
   this.GetType(),"OpenWindow","window.open('YourURL','_newtab');",true);
}



参考链接 http://stackoverflow.com/questions/10493901/how-to-open-a-page -in-new-tab-on-button-click-in-asp-net [ ^ ]


这篇关于如何在asp.net的新窗口中打开页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆