Solved

Pass a control to a class

Posted on 2011-09-16
1
224 Views
Last Modified: 2012-05-12
I have a button with the ID "Button1" on a web page.  I want to pass it to a Class that determines if the user has the rights to view it.  If not, then I want to set visible=false.
How do I pass a control to a Class?
0
Comment
Question by:rrhandle8
1 Comment
 
LVL 21

Accepted Solution

by:
Dale Burrell earned 250 total points
ID: 36553129
Something like:

-----

MyClass NewMyClass = new MyClass();

NewMyClass.CheckPermission(Button1);

------

public class MyClass
{
    public MyClass() {}

    public void CheckPermission(LinkButton In)
    {
        if (/* Some Test*/) In.Visible = true; else In.Visible = false;
    }
}
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question