Ideal way of posting a value to a new page?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Ideal way of posting a value to a new page?

    Is there any ideal way of passing values to another page using Post method
    and avoiding Sessions and Viewstate?

    I have used Viewstate unsuccessfully. Though I've set all the required
    attributes to the form including enableviewstatemac property to false. But
    it did not work.

    The I used the following code:
    In the source page add the code:

    Me.Context.Items.Add("Value", txtValue.Text)

    In the destination page add the code :

    Me.Context.Items.Item("Value").ToString

    This was working on my machine but when I moved it to the client's server, I
    was getting error "Viewstate corrupted". I felt the problem was with the
    client's .NET Framework version. They use 1.0 whereas I use 1.1. So, atlast
    I pulled in the Session. This was working fine. After I use the data fetched
    by the session, I am putting the value in the ViewState of the destination
    form and killing the session (Session("ID") = Nothing). Now, If I click on
    the browser's refresh button, my application does not work because I don't
    have the value in the session. And the Viewstate also does not contain the
    stored value wither.

    I can't retain the value in the session because else where in the
    application I am opening the same page but then don't pass any values.

    I was thinking there should be an ideal way to post values to a new page
    other than using Viewstate and Session.

    --


    Thank you.

    Satish Appasani
    #201, Wing - 1, Block - D
    Cyber Gateway
    Hyderabad - 500 081, India
    Phone: +91(40)2311-1356 Ext-122
    Mobile: +91(40)333-31032
    E-mail: [email]satish@vertexcs.com[/email]


    Satish Appasani Guest

  2. Similar Questions and Discussions

    1. Posting vars to a .php page
      Can I use the getUrl function to post a form in flex to a php file and the insert all my post vars??
    2. Posting ASP .Net web form to another asp page
      Hi, I need help in posting asp .net application web form to another asp based web app. I have seen many examples using HttpWebRequest class...
    3. Posting to another page question
      Hi! I have Portal application which is on http. However I like to do user authentification using SSL I like approach most sites use: They...
    4. Ideal website only Flash?
      Hello, Suppose you want to build the ideal website. No problems with different explorers (even the exotic ones), no problems with different...
    5. posting to another aspx page
      Hi! This is my problem: I want to go from page1 to page2, and to get all the form variables from page1 to page2. I have turned the...
  3. #2

    Default Re: Ideal way of posting a value to a new page?

    Hi,

    If I understood you correctly you trying to pass a Form data from page
    to page (using server.transfer ?) and getting invalid viewstate. If this
    is the case the reason is related to the fact that the target page tries
    to get the last state of controls from the forms __viewsatate field but
    the control tree of the target page don’t match the control tree stored
    in __viewstate. You can workaround it by sending the Form as an object
    in the Context object and get its values in the target page.

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

Posting Permissions

  • You may not post new threads
  • You may 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