see07 Posted April 20, 2004 Posted April 20, 2004 Hello everybody: Are there somebody here able to help me? I�m using a WebUserControl embedded into a WebForm, I need when a user clicks a button placed into the WebUserControl be launched the click event of another button placed into the WebForm. How can I do this? I attempted launch the click event from WebUserControl thus Gestion.ConsultaIntra.Peticion.cmdButton1_Click(Gestion.ConsultaIntra.Peticion.Button1, null); In WebForm I have: namespace Gestion.ConsultaIntra public class Peticion : System.Web.UI.Page protected System.Web.UI.WebControls.Button Button1; public void Button1_Click(object sender, System.EventArgs e) { } When I compile the project send the error: CS0122 �It�s not accessible due its protection level�. What is wrong with this? Would you be able to help me? I�ll appreciate your suggestions A.L. Quote
Moderators Robby Posted April 20, 2004 Moderators Posted April 20, 2004 First your event should be Protected. Why should one page handle another page's events, there is no need for this. You should create a class to handle whatever is common to both pages. Quote Visit...Bassic Software
see07 Posted April 20, 2004 Author Posted April 20, 2004 Yes, I know, but really I need to launch Page_Load event through clicking Button... Quote
georgepatotk Posted April 21, 2004 Posted April 21, 2004 i think you need to do it with object oriented style: for example: Dim ptc as new Peticion ptc.FormLoad 'call the function instead of event in the object Quote George C.K. Low
Moderators Robby Posted April 21, 2004 Moderators Posted April 21, 2004 Do you want to execute the code that lies within the PageLoad or do you want to open that page? Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.