Solved

read input value by asp

Posted on 2002-07-18
11
492 Views
Last Modified: 2008-03-03
hi

how i can read data from input box value in asp
not by using "submit"
just in the same page

somthing like that in vbscript:

Vr = myformname.textname.value
how i can do this statment in ASP

ASAP
plz
0
Comment
Question by:issamtaher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
  • 2
  • +1
11 Comments
 
LVL 4

Expert Comment

by:AlonHirsch
ID: 7161865
Hi,

You can not perform this in ASP.
ASP is Server side code and HTML is Client Side.
The only way you can get Client Side information to the Server Side (ASP) is by submitting the form.
On the Server Side (ASP) there is only text files (.asp etc.) that need to be processed by the server.
When a user requests a page, the server processes the .asp page and build HTML to send back to the Client (browser).

HTH,
Alon
0
 
LVL 1

Author Comment

by:issamtaher
ID: 7161873
so  AlonHirsch and all

how i can read URL parameter in asp
www.mypage.com ? Id=100 & Name=ttt

how i can read Id and Name

somthing like location.search in VBscript

thx alot
0
 
LVL 8

Expert Comment

by:drittich
ID: 7161893
Dim sID, sName
sID = Request.QueryString("Id")
sName = Request.QueryString("Name")
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:issamtaher
ID: 7161896
so  AlonHirsch and all

how i can read URL parameter in asp
www.mypage.com ? Id=100 & Name=ttt

how i can read Id and Name

somthing like location.search in VBscript

thx alot
0
 
LVL 4

Accepted Solution

by:
AlonHirsch earned 250 total points
ID: 7161898
Hi,

If your URL is http://www.mypage.com?Id=100&Name=ttt
(no spaces!!!) then in the ASP page you would read the ID and Name as follows :
<%
   ' declare variables to store the ID and Name (variants)
   dim vID
   dim vName

   ' get the ID from the URL
   vID = Request.QueryString("ID")
   vID = Request.QueryString("Name")
%>

If you are posting the variables from within a FORM on the HTML, you would use Request.Form instead of Request.QueryString

HTH,
Alon
0
 
LVL 1

Author Comment

by:issamtaher
ID: 7161902
so  AlonHirsch and all

how i can read URL parameter in asp
www.mypage.com ? Id=100 & Name=ttt

how i can read Id and Name

somthing like location.search in VBscript

thx alot
0
 
LVL 1

Author Comment

by:issamtaher
ID: 7161917
so  AlonHirsch and all

how i can read URL parameter in asp
www.mypage.com ? Id=100 & Name=ttt

how i can read Id and Name

somthing like location.search in VBscript

thx alot
0
 
LVL 1

Author Comment

by:issamtaher
ID: 7161920
thaks alot
0
 
LVL 1

Author Comment

by:issamtaher
ID: 7161924
thanks alot sir
0
 
LVL 2

Expert Comment

by:chops123
ID: 7161953
Although this isnt possible using ASP,its quite possible using a client side script like VBScript or Javascript.

You can do something like this..

<SCRIPT LANGUAGE=VBScript TYPE="text/vbscript">
   makeMsgBox = InputBox("Enter Name !","Title","")
   msg = "Hi " & makeMsgBox & " how are you !"
   document.write msg
</SCRIPT>


Regards
KC
0
 
LVL 8

Expert Comment

by:drittich
ID: 7161982
Two things:

1) I answered prior to Alon..., and
2) If you are using his code, change

vID = Request.QueryString("Name")

to

vName = Request.QueryString("Name")
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question