a variable question

Results 1 to 5 of 5

Thread: a variable question

  1. #1
    Join Date
    Dec 1969

    Default a variable question

    retriving variable values<BR><BR>NOTE: I CANNOT USE SESSIONS AND I DONT WANT TO USE SESSION.<BR>WITHOUT USING SESSIONS HOW CAN I DO THIS TASK.<BR><BR>i have 3 asp pages<BR><BR>1.asp<BR><BR>contains the form tag and the form fields...<BR><BR>2.asp<BR><BR>is the processing page..& showing results<BR><BR>2.asp has a page 3.asp(has the functions for the layout of 2.asp) in the include section like:<BR><BR>&#060;!-- #include file="3.asp" --&#062;<BR><BR>i have to written programme like this...<BR><BR>the 2.asp will request the text fields of 1.asp and<BR>checks whether the value is there or not. if there is no<BR>value...it redirects back to the 1.asp. if there is value<BR>it should show results. the processing of showing results <BR>are stored in the function in the page 3.asp as it is a page which<BR>contains the layout for 2.asp<BR><BR>now....wat i want to do is: i want the value entered in 1.asp to be used in<BR>the function in the page 3.asp and show the results in 2.asp<BR><BR>ALERT: I CANNOT USE SESSIONS. IF I USE SESSION VARIABLES I CAN EASILY DO IT<BR><BR>without using session variables...how can i retreive the value <BR>which is typed in the text field of 1.asp in a function in the <BR>page 3.asp<BR><BR>i know that i have to use querystring...but how to use the querystring?<BR><BR>send me a short syntax.<BR>

  2. #2
    cholladay Guest

    Default IE5 Persistence/QueryString

    If your users are on IE5, check out this article on Persistence. Very cool...<BR>http://msdn.microsoft.com/workshop/author/persistence/overview.asp<BR><BR>QUERYSTRINGS:<BR><BR>Sending Page:<BR> 1) action="Page3.asp?parm1=&#060;%=server.urlEncode(v ar1)%&#062;&parm2=&#060;%=server.urlEncode(var2)%& #062;<BR>OR<BR> 2) onclick="SendPage()"<BR> ....<BR> function SendPage() {<BR> window.location= "Page3.asp?parm1=" + escape(MyForm.textBox.value) + "&parm2=" + escape(MyForm.textBox.value)<BR> }<BR><BR>On Page3:<BR> &#060;% dim strParm1, strParm2<BR> strParm1=request("parm1")<BR> strParm2=request("parm2")<BR>%&#062;<BR>

  3. #3
    Ryan S. Guest


    When dealing with forms you have your choice of 2 methods. GET and POST.<BR>Get makes all of your variables go into a querystring. This means that they are a part of the URL and are visible to the user. This also limits the length to 255 characters for all of your variables combined.<BR><BR>POST places it on the server memory and its length is unlimited.<BR><BR>On the second page do a request.form("variable")<BR><BR>SO it would look like<BR><BR>UserID = request.form("UserID")<BR>

  4. #4
    Join Date
    Dec 1969


    You could also pass the variable values from page-to-page using<BR>the POST method and the following:<BR><BR>&#060;INPUT TYPE=HIDDEN NAME="&#060;var name&#062;" VALUE="value"&#062;<BR><BR>Just retrieve and post the data (hidden if not needed) each page. The only server resources used are while processing the next page.<BR>

  5. #5
    cholladay Guest

    Default RE: IE5 Persistence/QueryString

    OOPS! sorry for the bad advice. Scratch that thing about appending parameters to your form action. I have been coding in Visual Interdev&#039s scripting object model for a while, I&#039ve not tossed some bad habits. (But the persistence thing is pretty cool when you want to jump from page to page and "remember" information entered.)<BR><BR>Another thing you could do is use cookies.

Posting Permissions

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