Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • Moderators
Posted

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.

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...