Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Select OnAction in ASP?

Reply
Thread Tools

Select OnAction in ASP?

 
 
Johan Christensson
Guest
Posts: n/a
 
      09-29-2004
Hi.

I'm woundering if it's possibel to transfer a OnAction value from a
drop-down box in an ASP page without having to use Java code?

I mean something like this:

<%

Sub resposeprocess
some code,......
End Sub

%>

<Select name="DropDownMenu onAction="responseprocess">
<Option value="1">Value 1</option>
<Option value="2">Value 2</option>
</Select>

Can i get holds of the value from the drop-down box and use it inte the
subroutibe?

/Johan Ch


 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      09-29-2004
No, not really. See, with the way ASP works, there is no "built-in" way to
interact between client and server. How things work is:


1. Browser enters URL, which in turn sends an http request to a server.
2. Server receives request, loads the page, runs any ASP code that may be
in it.
3. After all the code is run or a Response.End is reached, the resultant
HTML is sent back to the client (browser) that made the request.

So, you see, by the time your onAction (what's that?) event happens, there
is no server sitting there connected to the browser waiting for a subroutine
call. You have to have the browser make another request to the server. For
example:



<%
If Request.Querystring("choice") <> "" Then Call resposeprocess()
Sub resposeprocess()
''some code
Response.Write "Sub routine ran."
Response.Write "<br>Option chosen: " & Request.Querystring("choice")
End Sub
%>

<select name="DropDownMenu"
onchange="location.href='thispage.asp?choice='+thi s.value;">
<option value="1">Value 1</option>
<option value="2">Value 2</option>
</select

So, that's using JavaSCRIPT, which you didn't want to do, but you either
have to use that or encapsulate this in a form with a submit button that the
user will have to click on to send the new request to the server.

Ray at home

"Johan Christensson" <> wrote in message
news:...
> Hi.
>
> I'm woundering if it's possibel to transfer a OnAction value from a
> drop-down box in an ASP page without having to use Java code?
>
> I mean something like this:
>
> <%
>
> Sub resposeprocess
> some code,......
> End Sub
>
> %>
>
> <Select name="DropDownMenu onAction="responseprocess">
> <Option value="1">Value 1</option>
> <Option value="2">Value 2</option>
> </Select>
>
> Can i get holds of the value from the drop-down box and use it inte the
> subroutibe?
>
> /Johan Ch
>



 
Reply With Quote
 
 
 
 
Jeff Cochran
Guest
Posts: n/a
 
      09-29-2004
On Wed, 29 Sep 2004 02:20:18 +0200, "Johan Christensson"
<> wrote:

>I'm woundering if it's possibel to transfer a OnAction value from a
>drop-down box in an ASP page without having to use Java code?


Sure. It could be JavaScript, ActiveX or anything else tht will
operate on the client side.

>I mean something like this:
>
><%
>
>Sub resposeprocess
> some code,......
>End Sub
>
>%>
>
><Select name="DropDownMenu onAction="responseprocess">
><Option value="1">Value 1</option>
><Option value="2">Value 2</option>
></Select>
>
>Can i get holds of the value from the drop-down box and use it inte the
>subroutibe?


No. The ASP page is processed and sent to the client. Then the
client changes something. The ASP is done, so the client has to
trigger sending something to the server. Which means some type of
client side code, be it Java, JavaScript, ActiveX or a "Submit"
button.

Jeff
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
select gridview row without using select button? =?Utf-8?B?RGFiYmxlcg==?= ASP .Net 5 02-27-2009 02:56 AM
select.select and socket.setblocking Laszlo Nagy Python 12 01-03-2009 09:25 PM
select.select() on windows jas Python 4 10-27-2005 11:10 AM
Selection from One SELECT changes selected option of another SELECT? J. Hall HTML 2 04-21-2004 05:36 PM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57