HELP - Link Button on User Control 'Losing its Mind'

N

Normie Smith

Hello...

I have a strange situation happening, and I thought maybe I could get some assistance.

I have created a simple user control (.ascx) file that's part of my default.aspx page. The user control contains a link button control, such as:

<asp:LinkButton id="idLinkButtonopenAll" runat="server">open all</asp:LinkButton>

Then in my code-behind file, I have it's event handler, such as:

public class reports : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.LinkButton idLinkButtonopenAll;

private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
// Other code here...
}
}


private void idLinkButtonopenAll_Click(object sender, System.EventArgs e)
{
// Code here to be executed when the link button is clicked
}
}


Sometimes the link button works fine and executes the code contained in the event - private void idLinkButtonopenAll_Click(object sender, System.EventArgs e). But, other times (and I have not explanation why because I don't even make code changes or anything), the link button control seems to 'lose its mind,' meaning that it simply won't execute the code inside the event handler. I've put breakpoints inside the event handler and the control never even tries to execute the code in the event handler.

Has anyone seen or had this kind of problem? If so, what's going on? Or, am I possible doing something wrong?

Thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top