Just been asked this question as a true / false in a telephone job interview and was a little stumped. Any ideas?
You can get hold of the Response object from the HttpContext static object:
System.Web.HttpContext.Current.Response.Write("Some Text")
If current returns null then the code is not being run as part of a page request. If you get asked the question again then that's the answer but a follow up question should be "why would you need to?"
The short answer is yes. In an interview id mention UserControl for an example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With