Is it possible to add a messagebox to an ASHX Handler? I used a handler to pass data from a Web Service to an internal system and need a messagebox to pop up to ask the user to choose from one option or another.
Ick, Anything is possible I'm sure, but would ya really want to do it that way? I'd think the only way it'd be possible is to return javascript asking the question, but even then it would depend on the client to actually output the javascript to the user
correctly, and then send data back to the handler to allow processing of the response...basically two trips to the handler with different parameters...not ideal in my own general use of handlers.
It's an system internal to our employees and they need to be able to choose between one option or the other when pulling inventory from an online system. The script will perform the corresponding action based upon the option that the user chose.
Make sense?
I'm all ears for a better approach, but my options are also very limited due to the complexity and requirements of the system.
trbothead
Member
27 Points
33 Posts
Adding a messagebox to an ASHX Handler
Nov 18, 2010 02:57 PM|LINK
Is it possible to add a messagebox to an ASHX Handler? I used a handler to pass data from a Web Service to an internal system and need a messagebox to pop up to ask the user to choose from one option or another.
Blast2hell
Member
428 Points
86 Posts
Re: Adding a messagebox to an ASHX Handler
Nov 19, 2010 08:57 PM|LINK
Ick, Anything is possible I'm sure, but would ya really want to do it that way? I'd think the only way it'd be possible is to return javascript asking the question, but even then it would depend on the client to actually output the javascript to the user correctly, and then send data back to the handler to allow processing of the response...basically two trips to the handler with different parameters...not ideal in my own general use of handlers.
Developer
trbothead
Member
27 Points
33 Posts
Re: Adding a messagebox to an ASHX Handler
Nov 24, 2010 07:37 PM|LINK
It's an system internal to our employees and they need to be able to choose between one option or the other when pulling inventory from an online system. The script will perform the corresponding action based upon the option that the user chose.
Make sense?
I'm all ears for a better approach, but my options are also very limited due to the complexity and requirements of the system.
JoeBrockhaus
Member
8 Points
8 Posts
Re: Adding a messagebox to an ASHX Handler
Jul 06, 2012 02:44 PM|LINK
I'm not sure how you would want to handle the response back to the handler itself, but this is how you show a simple javascript alert:
var msg = string.Format( @"<script language='javascript'>alert('your text here');</script>"); context.Response.Write(msg);