Results 1 to 11 of 11

Thread: Server.transfer

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question Server.transfer

    Very strange: I use Server.transfer to post information to a new page with sessions. It's also possible to use response.redirect with this.
    My problem is, that when I run the application (webform1.aspx as startpage), type some text and clicks the button, then webform2.aspx is shown, fine. But when I click BACK, webform1.aspx is shown, but WITHOUT the text that I entered.

    My code is:
    Webform1:
    Code:
     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Session("test") = Me.TextBox1.Text
            Server.Transfer("webform2.aspx")
        End Sub
    Webform2:
    Code:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'Put user code to initialize the page here
            TextBox1.Text = Session("test")
        End Sub

  2. #2
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    thats just how it is
    Magiaus

    If I helped give me some points.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    I don't think so. One of my collegues sent me the code and when HE runs the application the textbox on webform1.aspx remain when you click Back. That's what he says. I haven't seen it myself.
    I can't believe that the form reloads when you click Back, is that true?

  4. #4
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    Okay I don't know. My pages keep the data when I hit back. I was thinking of the iframe on my rich edit control it goes empty because the javascript doesn't run.
    Magiaus

    If I helped give me some points.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    I think the reason is that I use VS2002, my collegue is using VS2003 and a lot of small bugs should be fixed in that release.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    Problem solved:
    I had to set
    Code:
    <pages smartNavigation="true" />
    in the web.config.
    Now everything works as it should

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    Sorry, when I restarted the project it didn't work again. I have no idea of what's going on

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    To Magiaus:
    Are you using VS2003? My collegue is using VS2003 and he has no problems. I am using VS2002, maybe it's necessary to upgrade.

  9. #9
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    no I'm using the original release of VS.Net Enterprise Arch. Just a warning btw. I have have a user control with allot of buttons and panels. It works great until I turn on SmartNav Then I get script errors caused by the smart nav javascript. I don't know if it's my Nav script include or what, but all smart nav supposidly does is remove the flicker between postbacks for ie5.5 or higher. So I don't bother with it since people on mac's and using non ie browsers don't get the effect anyway.
    Magiaus

    If I helped give me some points.

  10. #10
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    I wish I had 2003 though. I want to see these c++ window forms.....
    Magiaus

    If I helped give me some points.

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049
    Right, I have also turned off the SmartNav again, if I use this and Server.Transfer it's not possible to go back.
    It's still a mystery to me why it doesn't work, I have attatched my code, you can try it and see if the text remains "test app" when you enter that on page1.
    I am using VS2002 Proff.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width