CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: ASP question?

  1. #1
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    45

    ASP question?

    how can i send a variable or a value using Response.Redirect to the redirected asp page...

    Thanks

    waqas
    work, work and only work!!

  2. #2
    Join Date
    Jan 2002
    Location
    Helsinki, Finland
    Posts
    99
    This is a forum for client-side scripting

    You can pass variables in url, separated by question mark (?) and ampersands (&). httpString data can be accessed with Request(variable_name) method, likewise when processing form data.

    For example :
    Code:
    <%
    	Response.redirect("http://www.domain.com/query.asp?age=22&gender=male")
    %>
    and query.asp,
    either :
    Code:
    <script type="javascript">
    var aVariables = location.search.substring(0).split();
    
    //	aVariables contains : { [0]: "age=22", [1]: "gender=male" }.
    //	eval() method helps us to bring values into variables age and gender
    for (var iI=0;iI<aVariables.length;iI++)
    {
    	eval(aVariables[iI]);
    }
    </script>
    or :
    Code:
    
    <%
    	Dim age, gender
    	age	= Request.Querystring("age")
    	gender	= Request.Querystring("gender")
    %>
    Last edited by Zvona; July 2nd, 2002 at 01:53 AM.
    Zvona - First aid for client-side web design

  3. #3
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    45
    Thanks Zvona
    work, work and only work!!

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

Featured