Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

HttpContext.Current.Response.write is not working when called from C# class

$
0
0

Hi,

 I am trying to send a message to user when the code enters a Catch block. the block is within a C# class.

                try
                {
                    Context.SubmitChanges();
                }
                catch (Exception e)
                {

                    ErrNum = -1;
                    HttpContext.Current.Response.Write("Err: something went wrong");
                }

I do not get compilation error but when this code is getting executed, My web page tries to load something and stays forever in that state.

I am currently using the Response.Write, within the event handlers ad it works perfectly.

any help will be appreciated.

Kia


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>