Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 497
  • Last Modified:

read input value by asp

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
issamtaher
Asked:
issamtaher
  • 6
  • 2
  • 2
  • +1
1 Solution
 
Alon HirschSoftware Development ManagerCommented:
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
 
issamtaherAuthor Commented:
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
 
drittichCommented:
Dim sID, sName
sID = Request.QueryString("Id")
sName = Request.QueryString("Name")
0
Technology Partners: 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!

 
issamtaherAuthor Commented:
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
 
Alon HirschSoftware Development ManagerCommented:
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
 
issamtaherAuthor Commented:
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
 
issamtaherAuthor Commented:
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
 
issamtaherAuthor Commented:
thaks alot
0
 
issamtaherAuthor Commented:
thanks alot sir
0
 
chops123Commented:
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
 
drittichCommented:
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

Industry Leaders: 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!

  • 6
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now