I have a page with a user control. I have an event defined in the user control and my page is registering that event. When the event is fired from the user control, it calls the method in the page.
The problem is that in the method, I am attempting to set a panel to visible = false. As I mentioned, the event is called but setting the visible property on the panel has no affect. Just for the heck of it, I put a label on the page and updated the text and it doesnt update either.
Any suggestions?
Loading
jim van dickPosted Jun 1, 2011, 8:34 AM
The panel is on the page. Below are code snippets:
In the control:
I define a delegate and event:
public delegate void ListFilterComplete(object sender, EventArgs e);
public event ListFilterComplete FilterCompleted;
In a button click event, I fire off the event:
protected void btnCancel_Click(object sender, EventArgs e)
{
FilterCompleted(this, e);
}
On the page, I catch the event and toggle a couple of panels on the page:
protected void filtersPage_Complete(object sender, EventArgs e)
{
ToggleStuff(false);
}
private void ToggleStuff(bool settingFilters)
{
pnlTabs.Visible = !settingFilters;
pnlFilters.Visible = settingFilters;
LblTest.Text = "Jim Jim Jim";
}
Here is code in the aspx file. Note, I dynamically add the filter user control to the pnlFilters panel.
CssClass="tabStrip"
OnClientTabSelecting="onTabSelecting"
MultiPageID="WorkOrderListMultiPage"
OnTabClick="WorkOrderListTabStrip_TabClick"
Orientation="HorizontalTop">
OnPageViewCreated="WorkOrderListMultiPage_PageViewCreated"
CssClass="multiPage">
Thanks for the help.
JIm
Posted Jun 1, 2011, 12:31 AM
Where you have the panel inside the page or inside the user control?