The usual DNN approach is to place your view and edit controls (elements) in a module control or skin object not in the container itself as the container simply defines the visual appearance of the area surrounding your module and includes such objects such as the module title, action menu, print/rss icon, etc.
Module controls must inherit from the base class PortalModuleBase which includes a definition for the property IsEditable. Since IsEditable will return false when the state of the page is in View mode and when edit permission has not been granted to the user's role(s) in the module settings, this checking of page state and permission has been taken care of for you.
In your module control's markup you could set the Visible attribute of an Asp.Net control that will be databound as follows:
Visible='<%# IsEditable() %>'
or in the codebehind:
tbName.Visible = IsEditable()
If you must add edit controls directly to your container (which I don't recomend and have never tried), you could obtain a reference to the contained module using the static method defined in the Container class and define your own IsEditable method as follows:
Public Function IsEditable() As Boolean
Dim myModule As PortalModuleBase = GetPortalModuleBase(Me)
If myModule Is Nothing Then
Return False
Else
Return myModule.IsEditable()
End If
End Function