.net叶面使用试图状态来保存页面控件的相关信息
这样制定页面中runat=server的form的action属性是不行的
可以使用Response.Redirect("WebForm1.aspx");或者Server.Transfer("WebForm1.aspx");

解决方案 »

  1.   

    it is not recommended, but try to add this line to WebForm1.aspx:<%@ Page EnableViewStateMac="false" %>
      

  2.   

    谢谢(思归)!搞掂了.但必须点击两次Button2,才能提交页面.有什么好办法点击一次就行了!
    Button2.Attributes.Add("onclick", "Form1.action='WebForm1.aspx';Form1.submit();")
      

  3.   

    有些值取不到!
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            txt.Text = "select * from factory where " & DL.SelectedItem.Value.ToString
            Server.Transfer("WebForm1.aspx")
    End Sub提交页面:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            '在此处放置初始化页的用户代码
            If (Request.Form("txt") <> "") Then Label1.Text = Request.Form("txt") & Request.Form("DL")End Sub如果是这样的话,Label1.Text 的值会为空!
      

  4.   

    这里不能用Request了。
    C#中是这样子的,我不知道VB是怎么样写。
    WebForm1 wf = (WebForm1)Context.Handler;
    string txt = wf.txt;
      

  5.   

    提交后txt得到的是没有修改之前的值!
    真想不到asp.net还有那么多问题!(可能是我才疏学浅)
      

  6.   

    提交后txt得到的是没有修改之前的值?
    你是不是在page_load中没用 if not postback! then ........ end if
      

  7.   

    Button2.Attributes.Add("onclick", "Form1.action='WebForm1.aspx';")if you change form.action, you have to use Request.Form[ControlName] to retrieve their values
      

  8.   

    我已经是用Request.Form[ControlName]来访问的了,就是取不了动态付的值
      

  9.   

    还有,取一个checkbox控件的值时,老是报错!
    错误信息:System.FormatException: Input string was not in a correct format.我是这样访问的: Request.Form("Chkcus_code")
      

  10.   

    哦,我现在明白了,checkbox提交返回值是"on"而不是boolean值!