473,385 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Passing a string from HTML page to ASP

33
Hi,

I am using a HTML page as login page and my 2nd page is in ASP. I want to pass the values in the text boxes login name & password to the 2nd page and want to check its validity there. But I cant get these values in my 2nd page.
I have used the code

loginname = trim(Request.Form.Item("txtLogin")) in the 2nd page.

But only blank is returning..

At the same time, I have written the same code for passing some variables from one ASP page to other. It works fine...

Is this a problem due to HTML-ASP link ?
Plz help me...
Matsam
Jul 4 '07 #1
8 2113
Can you post some code - the form on the HTML page would be useful
Jul 4 '07 #2
ak1dnar
1,584 Expert 1GB
Hi,

I am using a HTML page as login page and my 2nd page is in ASP. I want to pass the values in the text boxes login name & password to the 2nd page and want to check its validity there. But I cant get these values in my 2nd page.
I have used the code

loginname = trim(Request.Form.Item("txtLogin")) in the 2nd page.

But only blank is returning..

At the same time, I have written the same code for passing some variables from one ASP page to other. It works fine...

Is this a problem due to HTML-ASP link ?
Plz help me...
Matsam
Hi Matsam,

Can you show us the codings that you made so far for HTML form and the .aspx page (if any)
Thanks !
Jul 5 '07 #3
Matsam
33
Hi Matsam,

Can you show us the codings that you made so far for HTML form and the .aspx page (if any)
Thanks !

Hi,

I am sorry that i didnt include the code...

Following is the code for 1st page
[html]
<form method="post" action="page2.asp" id=form1 name=form1>

<input name="txtLogin" size="34">

<input type="password" name="txtPwd" size="36">

<A href="page2.asp" > Connect</A>
[/html]

In the 2nd page:
Expand|Select|Wrap|Line Numbers
  1. loginname =  trim(Request.Form.Item("txtLogin"))
  2. pwd = trim(Request.Form.Item("txtPwd"))
  3. Response.write loginname  '>>>>> Prints nothing...
  4.  
Matsam
Jul 5 '07 #4
ak1dnar
1,584 Expert 1GB
Codebehind=VB
Expand|Select|Wrap|Line Numbers
  1. dim loginname as string =  trim(Request.Form("txtLogin"))
  2. dim pwd as string  = trim(Request.Form("txtPwd"))
  3. Response.write(loginname)
Jul 5 '07 #5
jhardman
3,406 Expert 2GB
the problem is that you linked to the asp page rather than submitting the form. You should use [html]<input type="submit" value="click here to continue">[/html] in order to submit the form data. alternatively you could submit the form with javascript when the user clicks the link. I'm not a javascript expert, but the code is something like this:[html]<A onClick="document.all.form.submit()"> Connect</A>[/html]Jared
Jul 5 '07 #6
ak1dnar
1,584 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1.  
  2. <form method="post" action="page2.asp" id="form1" name="form1">
  3. <input name="txtLogin" size="34"> 
  4. <input type="password" name="txtPwd" size="36">
  5. <!-- OR YOU CAN REMOVE THIS -->
  6. <A href="page2.asp" > Connect</A>
  7. <!--
  8. AND ADD THIS THIS TO SUBMIT THE FORM-->
  9. <input type="submit" valre="Click here">
  10. </form>
  11.  
Sorry i missed this Line,

[HTML]<A href="page2.asp" > Connect</A>[/HTML]
from the original Post.

Thanks!
Jul 6 '07 #7
Matsam
33
the problem is that you linked to the asp page rather than submitting the form. You should use [html]<input type="submit" value="click here to continue">[/html] in order to submit the form data. alternatively you could submit the form with javascript when the user clicks the link. I'm not a javascript expert, but the code is something like this:[html]<A onClick="document.all.form.submit()"> Connect</A>[/html]Jared

Hi,

Thanks for ur help. I tried the Submit button.. But still it is not working. On clicking the submit button nothing happens. It is not going to the next page.
My post code is

<head><TITLE>ASP Page</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">

<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0" >
<meta name="ProgId" content="FrontPage.Editor.Document">
<form method="post" action="Page2.asp" id=form1 name=form1>
</head>
------
------
------

<P align=center><INPUT id=submit1 type=submit value=Submit name=submit1>&nbsp;
---
--

Please help...

Matsam
Jul 6 '07 #8
Matsam
33
Hi,

Thanks for ur help. I tried the Submit button.. But still it is not working. On clicking the submit button nothing happens. It is not going to the next page.
My post code is

<head><TITLE>ASP Page</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">

<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0" >
<meta name="ProgId" content="FrontPage.Editor.Document">
<form method="post" action="Page2.asp" id=form1 name=form1>
</head>
------
------
------

<P align=center><INPUT id=submit1 type=submit value=Submit name=submit1>&nbsp;
---
--

Please help...

Matsam


Hi,

Many many thanks for ur help.
My problem is solved when i used submit instead of link to page2.

Thanks once again
Matsam
Jul 6 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
27
by: Oscar | last post by:
I am looking for a way to pass an ADO recordset that has been retrieved in an ASP page to another HTML-page. Is there someone who can provide me with a small sample or a link to see how this is...
8
by: CHouck | last post by:
I have what seems to be a simple problem but I can't figure it out. I have a page where I have a link with variables built in which I want to pass through the URL so another page can pick the...
3
by: Joe Bloggs | last post by:
Does anyone know if its possible to pass parameters or the values of Request.QueryString from a web page to a custom control class? I'm using a C# Web Application. For Example I have Web Page1...
6
by: Newbie | last post by:
How do I pass string values from one webform to another?
13
by: Maxim | last post by:
Hi! A have a string variable (which is a reference type). Now I define my Method like that: void MakeFullName(string sNamePrivate) { sNamePrivate+="Gates" }
4
by: B Squared | last post by:
I'm trying to pass a string from the current html page to one I'm calling. I've read (in the O'Reilly text) this involves using "?", but there's no example. For example, given I have a standard...
3
by: James Robertson | last post by:
I am new to the ASP and VB thing so be kind. Question I have is that I have created an ASPX web site to use as an E-Mail page. But I want to use this for a lot of users. Can I create the link on...
4
by: moondaddy | last post by:
I have a htm page where I need to pass some data to an aspx page as a means of sending data to the database. I don't need to see the aspx page so I was going to put it in a hidden iframe. This...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.