none
How to show java script alert message in asmx webservice page RRS feed

  • Question

  • Hi Everyone,

    I am passing a parameter to a .asmx Web-Service method. This parameter  I am passing to function which download the file from a share path.

    But before downloading the file I need to show a confirmation message from the user whether the user want to download the file or not.

    Can some one help me to show a confirmation pop-up message form ASMX page.

    Thursday, January 21, 2016 10:16 AM

Answers

  • An ASMX provides a service, not a UI. The UI you are looking at is strictly for discovery purposes. It is not actually used by any code that will call your service. Indeed clients may never actually see this screen unless they happen to manually browse for it. Therefore you cannot have UI interaction.

    Confirmation needs to occur in the app that will use your service. The client app would need to handle this using whatever approach is appropriate for them (javascript, messagebox, etc). If you need to record confirmation then you can expose a method that says the user confirmed but the actual confirmation UI has to be handled by the client. Some clients may not bother with confirmation at all.

    Michael Taylor
    http://blogs.msmvps.com/p3net

    Thursday, January 21, 2016 3:50 PM
    Moderator

All replies

  • ASMX issues can be discussed at the below forum. However, a service's job is not to popup some confirmation message to a client. It should return a status code of success or non success to the client.

    http://forums.asp.net/28.aspx/1?WCF+ASMX+and+other+Web+Services

    Thursday, January 21, 2016 10:28 AM
  • An ASMX provides a service, not a UI. The UI you are looking at is strictly for discovery purposes. It is not actually used by any code that will call your service. Indeed clients may never actually see this screen unless they happen to manually browse for it. Therefore you cannot have UI interaction.

    Confirmation needs to occur in the app that will use your service. The client app would need to handle this using whatever approach is appropriate for them (javascript, messagebox, etc). If you need to record confirmation then you can expose a method that says the user confirmed but the actual confirmation UI has to be handled by the client. Some clients may not bother with confirmation at all.

    Michael Taylor
    http://blogs.msmvps.com/p3net

    Thursday, January 21, 2016 3:50 PM
    Moderator