Solved

read input value by asp

Posted on 2002-07-18
11
491 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
  • 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
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.

 
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

Suggested Solutions

Title # Comments Views Activity
JSON error 4 70
PDF Embed pdfobject.js local path problem regular ASP 2 173
Using Classic ASP inside HTML pages 2 62
Query still returning duplicates 5 41
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
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/…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

766 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