我通过主页中的搜索按钮用
Response.Write("<Script>window.open('search.aspx?search="+this.search1.SelectedIndex.ToString()+"&word="+this.keyword.Text.Trim()+" target=_blank')</script>");
弹出一个窗口,怎样能让够再刷新主页的时候不在弹出它呢!!!
Response.Write("<Script>window.open('search.aspx?search="+this.search1.SelectedIndex.ToString()+"&word="+this.keyword.Text.Trim()+" target=_blank')</script>");
弹出一个窗口,怎样能让够再刷新主页的时候不在弹出它呢!!!
解决方案 »
- 修改GridView某行获取单元格的值
- 记录返回是空时,gridview要显示标题???
- csv导入到数据库中,csv中有浮点数字,导入后出现问题
- csdn是怎样运行xml作论坛的
- 蛙蛙请教:偶在CSDN发的好多问题都没有解决呢,我集中了一下,大家给看看
- 请问一个提交表单后的问题.
- 模糊查询的问题:我已经拖欠了N天了,大家帮我看看。
- 高手施援:如何对存储过程中返回的日期空值进行判断?谢谢!!!
- 在asp.net中如何调用自己定义的dll类型的文件??
- 如何在VS.NET集成环境里建立ASP.NET Web 应用程序
- 请教给位?
- 请高手指点迷津--关于一个取得图片链接的函数?----------(swzlxm(守望者)也请进来)
,显示窗体时,判断标示符
if (Session["IsFresh"].ToString()=="0")
{
Response.Write("<Script>window.open('search.aspx?search="+this.search1.SelectedIndex.ToString()+"&word="+this.keyword.Text.Trim()+" target=_blank')</script>");
}
else
{
Response.Write("<Script>location.href='search.aspx'</script>");
}
response.write已经把脚本写到页面了,用不用session好象都没效果的不知道我说的对不对
如果在Page_Load中
private void Page_Load(object sender, System.EventArgs e)
{
if(!(IsPostBack))
{
Response.Write("<Script>window.open('search.aspx?search="+this.search1.SelectedIndex.ToString()+"&word="+this.keyword.Text.Trim()+" target=_blank')</script>");
}
}
如果?写在 Button1_Click 事件,刷新是不会运行的
(Response.Write("<Script>window.open('search.aspx?search="+this.search1.SelectedIndex.ToString()+"&word="+this.keyword.Text.Trim()+" target=_blank')</script>");
)
在Page_Load中在代码前加: if(!(IsPostBack))
{
}
代码是写在private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)事件中的,该怎么做呢?to 可乐 劳烦给段代码看,谢谢!
直接
this.Response.Redirect("search.aspx?search="+this.search1.SelectedIndex.ToString()+"&word="+this.keyword.Text.Trim()+"");
Response.Write("<Script>window.open('search.aspx?search="+this.search1.SelectedIndex.ToString()+"&word="+this.keyword.Text.Trim()+" target=_blank')</script>");
已经将这段javascript 写入到客户浏览器 所以你刷新就会显示出来解决办法:
在主页的Page_Load中
private void Page_Load(object sender, System.EventArgs e)
{
this.Button1.Attributes.Add("onclick","JavaScript:return Test('WebForm2.aspx?aa=123')");
}
然后在Html 中加入:
<script language="javascript">
function Test(ss)
{
window.open(ss);
}
</script>
就可以了,按钮选执行客户端事件,然后在执行服务器端事件
{
// ページを初期化するユーザー コードをここに挿入します。
//this.Button1.Attributes.Add()
string path="search.aspx?search="+this.search1.SelectedIndex.ToString()+"&word="+this.keyword.Text.Trim()+" target=_blank";
this.Button1.Attributes.Add("onclick","JavaScript:return Test('" + path + "')");
}
用
window.opener.location.reload();
window.opener.location.href=window.opener.location.href
去刷新(其实是重定位了一下)父窗口
session 写的话 浪费大大的资源 而且没有必要