页面是由左,右上,右下页面构成
现在我在右下页面有个提交表单,在提交后我要刷新右下页面以便看见我提交的数据
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '在此处放置初始化页的用户代码
        If Not Page.IsPostBack Then
            config.connopen()
            dd_class.DataSource = config.getfrclass
            dd_class.DataTextField = "Name"
            dd_class.DataValueField = "Name"
            dd_class.DataBind()
            config.conn.Close()
        End If
    End Sub
    Sub addclass(ByVal sender As Object, ByVal e As EventArgs)
        If Page.IsValid Then
            config.connopen()
            If config.addfrclass(tb_name.Text, dd_class.SelectedValue) 这里是我提交的方法 Then
               //提交成功后怎么刷新页面那?如果是response.redirect(本页是没有效果的)
            Else
                Response.Write("<script>alert('添加出现错误')</script>")
            End If
            config.conn.Close()
        End If
    End Sub

解决方案 »

  1.   

    response.write("<Script>document.location.href='';</script>")
      

  2.   

    bjbr(bjbr)方法可以,问一句,这样是刷新的全部框架吗?
      

  3.   

    '删除
        Sub DatagridDelete(ByVal Sender As Object, ByVal e As DataGridCommandEventArgs)
            Dim id As Integer = e.Item.Cells(0).Text
            sqlstr = "delete from class where ID=" & id
            ’执行删除
            config.executestatement(sqlstr)
            Response.Write("<Script>document.location.href='classlist1.aspx';</script>")
            datagridbind()
    数据还是没有更新到,必须我手动在刷新一次,为什么?
      

  4.   

    Response.Write("<Script>top.location.href='classlist1.aspx';</script>")