locked
Adding a messagebox to an ASHX Handler RRS feed

  • Question

  • User154669300 posted

    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. 

    Thursday, November 18, 2010 10:57 AM

All replies

  • User511655918 posted

    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. 

    Friday, November 19, 2010 4:57 PM
  • User154669300 posted

    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. 

    Wednesday, November 24, 2010 3:37 PM
  • User-1795593612 posted

    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);



    Friday, July 6, 2012 10:44 AM