Solved

Pass a control to a class

Posted on 2011-09-16
1
202 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hangfire / asp.net sample 3 49
SignalR - getting new data from sql DB 5 79
c# regex: extract & replace text between braces 6 44
Replace &lt; with < 14 54
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

914 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now