ASP.NET打开新页面而不关闭原来的页面
ASP.NET打开新页面而不关闭原来的页面
Respose.Write("<script language='javascript'>window.open('"+ url +"');</script>"); (打开简洁窗口):
Respose.Write("<script language='javascript'>window.open('" + url + "','','resizable=1,scrollbars=0,status=1,menubar=no,toolbar=no,location=no, menu=no');</script>");
1. Response.Redirect("XXX.aspx",true)——直接转向新的页面,原窗口被代替;
2. Response.Write("<script>window.open('XXX.aspx','_blank')</script>")——原窗口保留,另外新增一个新页面;
3. Response.Write("<script>window.location='XXX.aspx'</script>")——打开新的页面,原窗口被代替;
4. Server.Transfer("XXX.aspx")——打开新的页面;
5. Response.Write("<script>window.showModelessDialog('XXX.aspx')</script>")——原窗口保留,以对话框形式打开新窗口;
6. Response.Write("<script>window.showModelDialog('XXX.aspx')</script>")——对话框形式打开新窗口,原窗口被代替;
相关文档:
ASP.NET 首页性能的十大做法
前言
本文是我对ASP.NET页面载入速度提高的一些做法,这些做法分为以下部分:
1.采用 HTTP Module 控制页面的生命周期。
2.自定义Response.Filter得到输出流stream生成动态页面的静态内容(磁盘缓存)。
3.页面GZIP压缩。
4.OutputCache 编程方式输出页面缓存。
5.删除页面空白字符串 ......
//根据主键来删除表中的数据。
//删除
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
OleDbConnection sqlConnection = new OleDbConnection(GetConnection());
& ......
其实所谓的伪静态页面,就是指的URL重写.
1.首先在web.config里写
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
</configSections>
2.在web.config里添加以下节点
<httpHandlers>
< ......
网上找到的一个办法,也可以解决 用回车键代替提交按钮时,用户常按回车(非常快速的点回车)导致重复提交的情况:
public class SubmitOncePage : System.Web.UI.Page
{
private string _strSessionKey;
&n ......
解决办法:app_code/ 存放一个类 用来截获HTTP
1.代码如下
using System;
using System.IO;
using System.Web;
using System.Text;
using System.Text.RegularExpressions;
/// <summary>
/// Removes whitespace from the webpage.
/// </summary>
public class ViewstateModule : IHttpModule
{
......