|
Hello, I m facing some problem in web user control property., i create 3 link buttons on wuc. and drag nd drop on all 3 aspx pages. now i want when i click on home.aspx then that this particular link is not click-able on home apsx or disable. Regards Rashid |
Loading
Kirtan PatelPosted Dec 15, 2009, 2:58 AM
if my answer helps you then please check "do you like this answer" check box :)
define Properies in your WebUser control For Enabling Disabling Each Hyperlinks like below code
public partial class WebUserControl : System.Web.UI.UserControl
{
public bool EnableLink1{
get { return HyperLink1.Enabled;}
set { HyperLink1.Enabled = value; }
}public bool EnableLink2
{
get { return HyperLink2.Enabled; }
set { HyperLink2.Enabled = value; }
}
}
and Now use it In Page Like Below to Disable Particular Links
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
WebUserControl1.EnableLink1 = false;
WebUserControl1.EnableLink2 = false;
}
}