<%@ Page Language="C#"
ID="test2_Page"
GeneratedSourceFile="/vfp/source/test2_Page.prg" %>
<%@ Register Assembly="WebConnectionWebControls" Namespace="Westwind.WebConnection.WebControls" TagPrefix="ww" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;CHARSET=iso-8859-1" /><linkrel="stylesheet"type="text/css"href="westwind.css"media="screen" /></head><body><formid="form1"runat="server"><ww:wwWebTabControlrunat="server"id="Tabs" SelectedTab="pageSelection"><TabPages><ww:wwWebTabPagerunat="server"id="Page1" TabPageClientId="pageInfo"Text=" Information"> </ww:wwWebTabPage><ww:wwWebTabPagerunat="server"id="Page2" TabPageClientId="pageSelection"Text="Selection"></ww:wwWebTabPage><ww:wwWebTabPagerunat="server"id="Page3" TabPageClientId="pagePostBack"Text="PostBacks"></ww:wwWebTabPage><ww:wwWebTabPagerunat="server"id="Page4" TabPageClientId="pageDisplay"Text="Display"></ww:wwWebTabPage><ww:wwWebTabPagerunat="server"id="Page5" TabPageClientId="pageDisplay"Text="Disabled"></ww:wwWebTabPage><ww:wwWebTabPagerunat="server"id="Page6" TabPageClientId="pageSamples"Text="Samples"></ww:wwWebTabPage></TabPages></ww:wwWebTabControl><!-- You can use wwWebPanels or just plain HTML elements -->><divid="pageInfo"class="blackborder tabpage"style="display: none"><h3>div 1 - keeps correct tab</h3></div><!-- Here we use a plain DIV tag for the tab page -->><divid="pageSelection"class="blackborder tabpage"style="display: none"><h3>div 2 - keeps correct tab</h3></div><divid="pagePostBack"class="blackborder tabpage"style="display: none"> <h3>div 3 - keeps correct tab</h3><ww:wwWebButtonrunat="server"ID="btnSubmit"Text="Post It to Server" Click="btnSubmit_Click" /></div><divid="pageDisplay"class="blackborder tabpage"style="display: none"><h3>div 4 - keeps correct tab</h3></div><divid="pageSamples"class="blackborder tabpage"style="display: none"><h3>div 5 -keeps correct tab</h3></div><br /><br /><ww:wwWebTabControlrunat="server"id="notTabs"><TabPages><ww:wwWebTabPagerunat="server"id="bad1" TabPageClientId="divNew"Text="div1"> </ww:wwWebTabPage><ww:wwWebTabPagerunat="server"id="bad2" TabPageClientId="divReceive"Text="div2"></ww:wwWebTabPage></TabPages></ww:wwWebTabControl><divid="divNew"><h3>div 1 - losing tab</h3></div><divid="divReceive"><h3>Div 2 - losing tab</h3><ww:wwWebButtonID="btnSearch"runat="server" Click="btnSubmit_Click"Text="Lose the tab" /></div></form></body></html>
Then, the Foxpro code:
*****************************************************************DEFINECLASS test2_Page as WWC_WEBPAGE OF WWC_WEBPAGE_FILE***************************************************************** *** Your Implementation Page Class - put your code here *** This class acts as base class to the generated page below *****************************************************************#IF .F.*** This line provides Intellisense: Ensure your path includes this page's locationLOCALthis as test2_Page_WCSX of test2_page.prg#ENDIFFUNCTION OnLoad()ENDFUNC* OnloadFUNCTION btnSubmit_click()endfuncENDDEFINE
The top tab bar is the most scaled down version from the samples that ship with Web Connection. Click on the "Postbacks" tab -- there is a web button there. When you click the button, the "Postbacks" tab stays active.
The second tab bar is similar, except that the ID is "notTabs". Click on the "div 2" tab and click the "lose the tab" button.
I've put up a live version of this code at
http://173.240.183.131/fpp/test2.fp
And, if you swap the ID tags between the wwTabControls, you can make the bottom one work, but not the top one.
..Geoff