1

I am developping an asp.net application. When an user clicks on a button, he calls a webservice passing also the parameter he has before entered in a textfield. When the webservice returns no results, it displays a popup, everything works well in local, but when I deploy my application on my windows server, the pop up is not displayed. This is my code:

        if (!string.IsNullOrEmpty(textbox.text))
        {
            try
            {
               //webservice call
               string result = webservice.function(textbox.text);
            }
            catch (SoapException ex)
            {
                string message = ex.Message;
                //this popup is not working on the deployed application
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "error from code behind", string.Format("alert('{0}')", message), true);
            }
        }

If I run my app from client side in chrome to see what is happening, I am having this :

When I run the localhost everything works well, the popup from soapexception is displayed with this message '[E_E1] [Parameter NotFound]'

When I run the server app, I am getting this error in chrome console :

<script type="text/javascript">
 //<![CDATA[
 alert('System.Web.Services.Protocols.SoapException: [E_E1] [Parameter NotFound]
   uncaught syntaxerror unexpected token illegal
   at API.method(String refHubsite) in d:\users\documents\visual     studio 2010\Projects\test\Code\API.cs:line 59
   at test.service.ethod(String sc) in     d:\users\documents\visual studio     2010\Projects\test\Service.asmx.cs:line 20')//]]>
</script>

It's like for the same code, the string message has differents values whether it's generated in soapexception from localhost or from webserver:

localhost : string message="[E_E1] [Parameter NotFound]"

server windows : string message="System.Web.Services.Protocols.SoapException: [E_E1] [Parameter NotFound]........", it seems to contains the full stackstrace instead of the localhost message value.

Thanks in advance for your help

user2443476
  • 1,935
  • 9
  • 37
  • 66
  • Please do not duplicate your questions. http://stackoverflow.com/questions/27101932/display-popup-to-user-in-asp-net-application-popup-from-local-application-is-di – Vladimirs Nov 24 '14 at 11:18
  • Yeah I know, but as I advance a little more in finding a solution, I thought that it would be more clear to create a new post instead of adding and adding updates on a orignal post that becomes difficult to understand. – user2443476 Nov 24 '14 at 11:20

0 Answers0