Showing posts with label couple. Show all posts
Showing posts with label couple. Show all posts

Wednesday, March 28, 2012

Linkbuttons in a TabContainer lose the active tab

Hi, I have a tabcontainer with a couple of panels. If I have a Button in each panel then clicking the button posts the page back and the tab panel I was in remains active/visible. BUT if I put a link button in Panel 2 and click that then the tabcontainer resets to the first panel.

Here is a simple example:

<cc1:TabContainer ID="TabContainer1" runat="server">
<cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="tab 1">
<ContentTemplate>
<asp:Button runat="server" ID="Button1" Text="postback 1" />
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="tab 2"> <ContentTemplate>

<asp:LinkButton runat=server ID=lnk1>postback from panel 2</asp:LinkButton>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>

If I put a button in panel 2 as well as the linkbutton then I get the same thing, BUT if I click the Button first then clicking the link button does not cause the tabcontainer to reset. Which seems to suggest that AJAX is using a button event in some way, but not a linkbutton.

This is causing me a major headache as I have already designed the UI and coded all the DB and middle-tier code, wiring the UI up was supposed to be the easy bit!Wink

Hoping someone can help

Andrew

This problem has been logged with the AJAX Control Toolkit developers as an issue and a workaround is detailed here:http://forums.asp.net/thread/1550723.aspx (basically wrap the tabcontainer in an update panel so that the non-Button postbacks get routed through the AJAX async handlers)

Linked Drop Down Lists

Hi,

I want to use Atlas to create a couple of linked drop down lists. So when you change one it will automatically fill another. Can anyone give me an example of how to do this using Atlas?

With the December release you could just use 2 DropDownList (ASP.NET) controls, and set AutoPostBack="true" on the first one. Handle its SelectedIndexChanged event and inside the handler populate the 2nd dropdown... Both dropdowns should be placed inside an Atlas UpdatePanel server control, and you should enable partial rendering (which is a property on the ScriptManager control). This should perform a callback when you change the selection in the first dropdown...