Solved

read input value by asp

Posted on 2002-07-18
11
487 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
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now