PRB: "?????? ??? ??????? ??? ????" ????? ??? ??? ??????? Server.Transfer

?????? ????????? ?????? ?????????
???? ???????: 316920 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

???????

??? ??????? HttpServerUtility.Transfer ("page name" ? true) ? ????? ????? ????? ???????:
???? ????? ??? ????? ???? ?????? ? ??? ???? ?????

?????

???? ??? ??????? ???? ??? EnableViewStateMac<pages> ??? ????? ???? ??? true ???? ???????. ??? ????? ??? ????? ??? "????" ? ???? ASP.NET ?????? ?????? ???? ?????? ?? ?????? ????? (MAC) ??? ???? ????? ??? ?????? ????? ??? ??? ?????? ??? ???? ?? ??????. ???? ??? ??????? ??? ?? ????? ???? ????? ??? ?????? ??? ??????. ?????? ??????? ?? ???????? ???????? ??? ????? ????? ??? true.

??? ??????? ??????? Server.Transfer ?????? ??????? ??????? ??? true ???????? QueryString ???????? ?????. ??? ???? ??????? ?? ??? ????? __VIEWSTATE ??????? ???? ????? ???? ????? ??? ??????. ???? ?????? ??????? ??? ???? ??? ??? ???????? ?????? ??????? ??? ??????? ?? ?? ????. ????? ????? ????? ?? ???? ???? ?????? Server.Transfer ??? ???? ??? ?????? ??????.

??? ???? ?????? ???? ?????? ???? ????? ???? ?????? ???. ??? ?? ?? ??? ??? ????? ????? ??? ???????.

????

??? ??? ???????? ?????? ???? ????? ???????.

????? 1

??? ????? ??? ????? ?????? ?????? ???? ?????? ??? ????? ????. ?????? ??? ???? ?? ?????????? ???? MSDN ?????? ???????:
??? ???? ???? ?????? ??????? ??? ???????
http://msdn2.microsoft.com/en-us/library/6c3yckfw(vs.71).aspx
????? ??? ????? ??????? ?????? ??? ????? ???? ?????? ???? ???? ?????? ?? ?????? ??????.

??? ??? ???? ?????? ?? ????? ?????? ??? ??? ???? ?? ?????? ??? ????? ????? ?????? ??? ?? ???? ???? ??????? ????? ????? ????? ?????? ??? ?? ????????? ????????. ??? ???? ??????:

Page1.aspx
Public Class Page1
    Public WithEvents TextBox1 As System.Web.UI.WebControls.TextBox

    'Insert your code here.
End Class
				
Page2.aspx
            Dim sourcePage As Page1
            sourcePage = CType(Context.Handler, WebForm1)
            Response.Write(sourcePage.TextBox1.Text)
				

????? 2

?? ????? ??????? ??????? (??? ????? ???? ???????) ??????? Server.Transfer. ??? ???? ??????:
Server.Transfer("<page name>")
				
??? ????? ?? ???? QueryString "?" ???? ??????? ??? ?????? ???? ????. ????? ??? ??? ??? ?????? ?? ???? ASP.NET ???????? ?????? ???????.

??????? ????

????? ????? ????? ?? ????

  1. ????? ???? .aspx ???? WebForm1.aspx ???? ??????? ??? ???? ????. ?? ?????? ????????? ???????? ??????? ??? WebForm1.aspx:
    <%@ Page language="vb" AutoEventWireup="true" %>
    
    <html>  
      <body>	
        <form id="WebForm1" method="post" runat="server">
          <asp:TextBox id="txtName" runat="server">Your Name</asp:TextBox><br>
          <asp:Button id="Button1" runat="server" Text="Submit" OnClick="Button1_Click"></asp:Button>
        </form>	
      </body>
    </html>
    
    <script runat=server>
    Sub Button1_Click(sender As Object, e As System.EventArgs)
    	Server.Transfer("WebForm2.aspx",true)
    End Sub
    
    </script>
    					
  2. ????? ???? .aspx ??? ???? WebForm2.aspx ?? ?? ?????? ???????? ???????? ???????:
    <%@ Page language="vb" AutoEventWireup="true" %>
    
    <html>
      <body>	
        <form id="WebForm2" method="post" runat="server">
          <asp:Label id="lblName" runat="server" >Web Form 2</asp:Label>
        </form>
    	
      </body>
    </html>
    
    <script runat=server>
    Sub Page_Load(sender As Object, e As EventArgs)
    
    Dim thisPage As System.Web.UI.Page
    Dim nameTextBox As TextBox
    
    	thisPage = CType(Context.Handler, System.Web.UI.Page)
    	nameTextBox =  CType(thisPage.FindControl("txtName"), System.Web.UI.Control)
    
    	lblName.Text = "Your name is '" & nameTextBox.Text & "'."	
    	
    End Sub
    
    </script>
    					
  3. ??? WebForm1.aspx ?? ???????? ????? ?? ?? ???? ??? ?????.

???????

???? ???????: 316920 - ????? ??? ??????: 02/???? ??????/1428 - ??????: 3.2
????? ???
  • Microsoft ASP.NET 1.0
????? ??????: 
kbmt kbprb kbstate kbwebforms KB316920 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????316920
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com