Disable user control image from master page in asp.net

Posted by Gopal_nivas under ASP.NET on 11/15/2011 | Points: 10 | Views : 2588 | Status : [Member] | Replies : 3
hi ..
i am using master page in that i have used user control to show the image.

i was in login page means the the user control image should not be shown.
after login only the image should be shown.

how to do this..

need ur suggestions with examples
regards
gopal.s




Responses

Posted by: Ndebata on: 11/15/2011 [Member] Starter | Points: 25

Up
0
Down
In the master page expose a public property to set visibility of the user control.

Then in your content page register the master page something like after page directive
<%@ MasterType VirtualPath="~/MasterPage.Master" %>


Now from the content page you can very well access and set the visibility based on your need by calling
Master.PropertyName





Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: RohiK on: 11/15/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

you need to create usercontrol object.
In that you have to find image control and then make it visible=false

try this
http://www.dotnetcurry.com/ShowArticle.aspx?ID=155

Happy Programming!!
Rohi

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: perfectchourasia-9163 on: 11/16/2011 [Member] Starter | Points: 25

Up
0
Down
i've managed to access controls on a master page like this:

Control control = Master.FindControl("ControlID");
if (control is ControlType)
{
ControlType menu = control as ControlType;
menu.Visible = false;
}

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response