<form name="123.asp">  onclick="javascript:123.submit()"

解决方案 »

  1.   

    服务器端用Response.Redirect.但是最好用js.<input type="button" value="Reload Page" onClick="window.location.href=window.location.href">
      

  2.   

    你就把跳转到本页面的代码封装成一个公共方法 以后用的时候只要调用就可以了 不需要传参数
    你的是按钮那你就把response.write("<script>location=location</script>");
    <script>可以写跳转本页面的方法</script>
      

  3.   

    在vs2008 asp.net中没有一个变量是表示当前页面的么?
      

  4.   

    有 用 location.href=<%=Reqest.RawUrl%>
      

  5.   

    updatepanel是实现无刷新页面的方法.你VS工具栏有
      

  6.   


     protected void Page_Load(object sender, EventArgs e)
        {
            bind();    }
        private void bind()
        {
            this.Repeater1.DataSource = TestManager.getAll();
            this.Repeater1.DataSourceID = "";
            this.Repeater1.DataBind();
        }
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
                string name = this.TextBox1.Text.Trim();
                DB_Test dbt = new DB_Test();
                dbt.Uname = name;
                int i = TestManager.Add(dbt);
                if (i > 0)
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "", "alert('成功')", true);
                    //Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('成功');", true);
                    bind();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "", "alert('失败')", true);
                    //Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('失败');", true);
                }
            
        }form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
            <asp:Repeater ID="Repeater1" runat="server">
            <ItemTemplate>
            <ul>
            <li>编号:<%#Eval("id")%></li>
            <li>姓名:<%#Eval("uname")%></li>
            <li>
                <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument='<%#Eval("id")%>' onclick="LinkButton2_Click">删除</asp:LinkButton></li>
            </ul>
            </ItemTemplate>
            </asp:Repeater>
             
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">添加</asp:LinkButton>
            </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        </form>这是无刷新页面.在按钮里绑定的代码.您看下。很好理解
      

  7.   

    在后台你也可以用Response.Redirect(URL)
      

  8.   

    Response.Redirect(Request.Url.ToString());Response.AddHeader("Refresh", "0");Response.Write("<script>window.location.reload();</script>");
      

  9.   

    ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>window.location=window.location;</script>");