Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all.I have been able to get the user conrtol in my page.However,i have never added items to a web use conrtol.The original control has links to STUDENTS and Teachers.Currenrltly,i need to change those links when a student logs in.At the moment,when a student logs in,he can be able to see some admin pages but now i need to show him different links on logging.Can someone guide me how to add the items in a page?Here is my code of the control
C#
LoginView control = (LoginView)Master.FindControl("LoginView1");
           var cont= (StudentsPanel)control.FindControl("StudentsPanel");
           if (cont!= null)
           {

            //Here  is where i need to add those links eg.since he his logged in a s a student,i will hide the original control with the admin pages and then add new links to the "Cont"
control.
           }


How can i accomplish thi?
Posted
Updated 28-Jan-14 23:32pm
v2

1 solution

you can try something like

C#
LoginView control = (LoginView)Master.FindControl("LoginView1");
           var cont= (StudentsPanel)control.FindControl("StudentsPanel");
           if (cont!= null)
           {
 controlID.controls.add(Write your control's id here to add control); 
          
           }


same way you can use controls.remove method to remove the controls.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900