Distinguish Design time in ASP.NET

From MSDN site:

The easiest method to check if the control is at design mode is simply to check the current HttpContext. If this variable returns Nothing, then the control is in design mode.

Private Function IsDesignMode() As Boolean
Try

If HttpContext.Current Is Nothing Then

mboolDesignMode
= True

Else

mboolDesignMode
= False

End If

Return
mboolDesignMode

Catch
Throw

End Try

End Function

Author: Pouya Panahy

Microsoft certified DevOps engineer with passion in analysing, designing and implementing solutions for Azure Cloud with hands-on experience in security and quality assurence.

Leave a Reply