Professional Web Applications Themes

Questions about Server.Transfer - ASP.NET General

I'm learning about Server.Transfer to see if it will be worthwhile so we can cut down on the number of session variables we use. And in doing a couple of tests following the .NET Framework SDK doentation (ms-help://MS.NETFrameworkSDKv1.1/cpguidenf/html/cpconpassingservercontrolva luesbetweenpages.htm), the example shows having the textbox controls as Protected, but when I tried to run the example and access the values in the text boxes from the first page on the second page, I wasn't able too because it said that the controls were protected. I changed them to public and it worked, but why does the example show that they ...

  1. #1

    Default Questions about Server.Transfer

    I'm learning about Server.Transfer to see if it will be worthwhile so we can
    cut down on the number of session variables we use. And in doing a couple
    of tests following the .NET Framework SDK doentation
    (ms-help://MS.NETFrameworkSDKv1.1/cpguidenf/html/cpconpassingservercontrolva
    luesbetweenpages.htm), the example shows having the textbox controls as
    Protected, but when I tried to run the example and access the values in the
    text boxes from the first page on the second page, I wasn't able too because
    it said that the controls were protected. I changed them to public and it
    worked, but why does the example show that they can be protected?

    Also, when I ran the example and clicked a button to go to the second page,
    the browser's address bar had the address of the first page when I was on
    the second page. I understand why that is, but does it have to be that way?
    It would be less confusing if it showed the page that was actually being
    run.

    I appreciate any help.

    Thanks,
    --
    Melissa Whalen, Programmer/yst
    AIT, BBA/IS



    Melissa Guest

  2. #2

    Default Re: Questions about Server.Transfer


    "Melissa" <com> wrote in message
    news:phx.gbl... 
    the 
    because 

    No idea. Typo?
     
    page, 
    way? 

    The client browser is never notified of the server.transfer event; so it
    still thinks it's looking at the original page it requested. The resulting
    asynchronous situation can produce funky pathing issues, namely virtual
    paths.


    e Guest

  3. #3

    Default Re: Questions about Server.Transfer

    > Protected, but when I tried to run the example and access the values in
    the 
    because 

    The example show using Protected Server Controls, but the class exposes
    Public properties that return the values of the Protected controls.
    Protected means that the properties are not exposed to any class that
    doesn't inherit the class specified. That is why the Public properties are
    used to expose the values in the Protected controls.
     
    page, 
    way? 

    If you want that, you will have to use Response.Redirect. The address shown
    in the browser's address window is the address of the URL that was
    requested. Server.Transfer happens on the server side, not on the client.
    Response.Redirect sends a response header to the browser telling it to
    request another URL.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Neither a follower nor a lender be.

    "Melissa" <com> wrote in message
    news:phx.gbl... 
    can 
    (ms-help://MS.NETFrameworkSDKv1.1/cpguidenf/html/cpconpassingservercontrolva 
    the 
    because 
    page, 
    way? 


    Kevin Guest

Similar Threads

  1. Error Server.Transfer / Server.Execute ()
    By Abdul Azeem in forum ASP Database
    Replies: 2
    Last Post: June 30th, 01:46 PM
  2. Replies: 1
    Last Post: September 9th, 04:44 PM
  3. Is Server.Transfer secure?
    By Chris Jackson in forum ASP.NET Security
    Replies: 0
    Last Post: August 26th, 05:20 PM
  4. Server.Transfer
    By Ali Nasir in forum ASP.NET General
    Replies: 4
    Last Post: August 26th, 05:21 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139