Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Problem in passing a variable value from one page to another


Message #1 by "Khalid Qureshi" <khalidone@y...> on Mon, 6 Jan 2003 10:28:32
Hi,
I have written a piece of code to pass a value of variable from one page 
to another page but I am failed to receive that value in the next page the 
code is as follows

Note: I have to pass this value using a hyperlink

Page 1 from which I am passing value

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>

<% 
Dim strName
strName="Khalid"
%>


<p><a href="Pass.asp?kvalue="<% =("strName") %>"">Link</a></p>


</body>
</html>

Page 2 in which I want to receive value of a variable
 
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>
<INPUT TYPE="text" Name="Login_ID" VALUE="<%= Request ("kvalue") %>">
</body>

</html>

Please correct this code. It will be a great help for me.
Message #2 by "slakshmi" <slakshmi@i...> on Mon, 6 Jan 2003 16:45:39 +0530
Hi,

In your 1st page href shud be like this:

<p><a href="Pass.asp?kvalue=<%=strName%>">Link</a></p>
or
<p><a href="Pass.asp?kvalue='"&<%=strName%>&"'">Link</a></p>

And in your 2nd page: where you want to access the variable,

<% Login_id = trim(request.querrystring("kvalue"))%>
<INPUT TYPE="text" Name="Login_ID" VALUE="<%= Login_id %>" >

Cheers,
Sree
----- Original Message -----
From: "Khalid Qureshi" <khalidone@y...>
To: "ASP Databases" <asp_databases@p...>
Sent: Monday, January 06, 2003 10:28 AM
Subject: [asp_databases] Problem in passing a variable value from one page
to another


> Hi,
> I have written a piece of code to pass a value of variable from one page
> to another page but I am failed to receive that value in the next page the
> code is as follows
>
> Note: I have to pass this value using a hyperlink
>
> Page 1 from which I am passing value
>
> <html>
>
> <head>
> <meta http-equiv="Content-Language" content="en-us">
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
> <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
> <meta name="ProgId" content="FrontPage.Editor.Document">
> <title>New Page 1</title>
> </head>
>
> <body>
>
> <%
> Dim strName
> strName="Khalid"
> %>
>
>
> <p><a href="Pass.asp?kvalue="<% =("strName") %>"">Link</a></p>
>
>
> </body>
> </html>
>
> Page 2 in which I want to receive value of a variable
>
> <html>
>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
> <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
> <meta name="ProgId" content="FrontPage.Editor.Document">
> <title>New Page 1</title>
> </head>
>
> <body>
> <INPUT TYPE="text" Name="Login_ID" VALUE="<%= Request ("kvalue") %>">
> </body>
>
> </html>
>
> Please correct this code. It will be a great help for me.

Message #3 by Mark Eckeard <meckeard2000@y...> on Mon, 6 Jan 2003 05:00:17 -0800 (PST)
Small typo.

This:

<% Login_id = trim(request.querrystring("kvalue"))%>

Should be:

<% Login_id = trim(request.querystring("kvalue"))%>
(only 1 'r' in 'querystring')

Mark
--- slakshmi <slakshmi@i...> wrote:
> Hi,
> 
> In your 1st page href shud be like this:
> 
> <p><a
> href="Pass.asp?kvalue=<%=strName%>">Link</a></p>
> or
> <p><a
>
href="Pass.asp?kvalue='"&<%=strName%>&"'">Link</a></p>
> 
> And in your 2nd page: where you want to access the
> variable,
> 
> <% Login_id = trim(request.querrystring("kvalue"))%>
> <INPUT TYPE="text" Name="Login_ID" VALUE="<%
> Login_id %>" >
> 
> Cheers,
> Sree
> ----- Original Message -----
> From: "Khalid Qureshi" <khalidone@y...>
> To: "ASP Databases" <asp_databases@p...>
> Sent: Monday, January 06, 2003 10:28 AM
> Subject: [asp_databases] Problem in passing a
> variable value from one page
> to another
> 
> 
> > Hi,
> > I have written a piece of code to pass a value of
> variable from one page
> > to another page but I am failed to receive that
> value in the next page the
> > code is as follows
> >
> > Note: I have to pass this value using a hyperlink
> >
> > Page 1 from which I am passing value
> >
> > <html>
> >
> > <head>
> > <meta http-equiv="Content-Language"
> content="en-us">
> > <meta http-equiv="Content-Type"
> content="text/html; charset=windows-1252">
> > <meta name="GENERATOR" content="Microsoft
> FrontPage 4.0">
> > <meta name="ProgId"
> content="FrontPage.Editor.Document">
> > <title>New Page 1</title>
> > </head>
> >
> > <body>
> >
> > <%
> > Dim strName
> > strName="Khalid"
> > %>
> >
> >
> > <p><a href="Pass.asp?kvalue="<% =("strName")
> %>"">Link</a></p>
> >
> >
> > </body>
> > </html>
> >
> > Page 2 in which I want to receive value of a
> variable
> >
> > <html>
> >
> > <head>
> > <meta http-equiv="Content-Type"
> content="text/html; charset=windows-1252">
> > <meta name="GENERATOR" content="Microsoft
> FrontPage 4.0">
> > <meta name="ProgId"
> content="FrontPage.Editor.Document">
> > <title>New Page 1</title>
> > </head>
> >
> > <body>
> > <INPUT TYPE="text" Name="Login_ID" VALUE="<%
> Request ("kvalue") %>">
> > </body>
> >
> > </html>
> >
> > Please correct this code. It will be a great help
> for me.
> 
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
Message #4 by "Ron Williams" <ronwilliams32@c...> on Tue, 7 Jan 2003 21:38:31
Hi,

the first response is correct, but may not be completely clear. to add a 
little...

 you put quotes around the strName variable and the ASP tags,

<p><a href="Pass.asp?kvalue="<% =("strName") %>"">Link</a></p>

dont put quotes around a variable (nor the ASP tag in this case, some 
cases that is ok). write it like this...

<p><a href="Pass.asp?kvalue=<%=strName%>">Link</a></p>


Second, you left off the name of the Request object's collection that you 
wanted to get data from,

<INPUT TYPE="text" Name="Login_ID" VALUE="<%= Request ("kvalue") %>">


write it like this...


<input type="text" ... VALUE="<%=Request.QueryString("kvalue") %>">

quotes around the ASP tags are ok here (the ... represents where the Name 
attribute would go).

hope this helps.

ron

> Hi,

In your 1st page href shud be like this:

<p><a href="Pass.asp?kvalue=<%=strName%>">Link</a></p>
or
<p><a href="Pass.asp?kvalue='"&<%=strName%>&"'">Link</a></p>

And in your 2nd page: where you want to access the variable,

<% Login_id = trim(request.querrystring("kvalue"))%>
<INPUT TYPE="text" Name="Login_ID" VALUE="<%= Login_id %>" >

Cheers,
Sree
----- Original Message -----
From: "Khalid Qureshi" <khalidone@y...>
To: "ASP Databases" <asp_databases@p...>
Sent: Monday, January 06, 2003 10:28 AM
Subject: [asp_databases] Problem in passing a variable value from one page
to another


> Hi,
> I have written a piece of code to pass a value of variable from one page
> to another page but I am failed to receive that value in the next page 
the
> code is as follows
>
> Note: I have to pass this value using a hyperlink
>
> Page 1 from which I am passing value
>
> <html>
>
> <head>
> <meta http-equiv="Content-Language" content="en-us">
> <meta http-equiv="Content-Type" content="text/html; charset=windows-
1252">
> <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
> <meta name="ProgId" content="FrontPage.Editor.Document">
> <title>New Page 1</title>
> </head>
>
> <body>
>
> <%
> Dim strName
> strName="Khalid"
> %>
>
>
> <p><a href="Pass.asp?kvalue="<% =("strName") %>"">Link</a></p>
>
>
> </body>
> </html>
>
> Page 2 in which I want to receive value of a variable
>
> <html>
>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=windows-
1252">
> <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
> <meta name="ProgId" content="FrontPage.Editor.Document">
> <title>New Page 1</title>
> </head>
>
> <body>
> <INPUT TYPE="text" Name="Login_ID" VALUE="<%= Request ("kvalue") %>">
> </body>
>
> </html>
>
> Please correct this code. It will be a great help for me.


  Return to Index