I have a partial view/user control called LogOnUserControl which I display in a side bar on my site (defined in Site.Master). I also have a separate LogOn view, which also renders the LogOnUserControl.
I don't want two instances of the LogOnUserControl in the LogOn view, because it's just plain confusing, so my current thinking is to include a condition such as
// Semi-pseudocode
if (!Request.IsAuthenticated) && View.Name != "LogOn")
in the LogOnUserControl.
This feels wrong, as the partial view now knows about the LogOn view. Also, I can't find out how to get the View's name, which reinforces the feeling that I'm doing something wrong! :-)
Edit: There is the further complication that the same partial view is used for both the LogOn view and the sidebar in Site.Master.