Hi,
I've got a problem i can't figure it out. I have 1 nested master page. In the nested master page i have a MultiView control with 3 Views. Two of these Views are ContentPlaceHolders and one is 'static'.Nested MasterPage is used for tabbed content. Here is the code for the nested MasterPage (Tabs.master):
<%@ Master Language="C#" MasterPageFile="~/MasterPa
ge.master"
AutoEventWireup="true" CodeFile="Tabs.master.cs" Inherits="Tabs" %>
<asp:Content ID="tabContent" ContentPlaceHolderID="main
ContentPla
ceHolder" Runat="Server">
<asp:Menu ID="Menu1" Width="190px" runat="server" CssClass="tabs" Orientation="Horizontal" StaticMenuItemStyle-CssCla
ss="tab" StaticSelectedStyle-CssCla
ss="select
edTab" OnMenuItemClick="Menu1_Men
uItemClick
">
<Items>
<asp:MenuItem Text="Foo1" Value="0"/>
<asp:MenuItem Text="Foo2" Value="1"/>
<asp:MenuItem Text="Foo3" Value="2"/>
</Items>
</asp:Menu>
<div class="tabContents">
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="1">
<asp:View id="Tab1" runat="server">
<table width="600" height="400" cellpadding=0 cellspacing=0>
<tr valign="top">
<td style='width: 600px'>
<asp:ContentPlaceHolder ID="addNewContent" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</asp:View>
<asp:View ID="Tab2" runat="server">
<table width="600" height="400" cellpadding=0 cellspacing=0>
<tr valign="top">
<td style='width: 600px'>
<asp:ContentPlaceHolder ID="editContent" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</asp:View>
<asp:View ID="Tab3" runat="server">
<br />This is the third view
<br />This is the third view
<br />This is the third view
<br />This is the third view
</asp:View>
</asp:MultiView>
</div>
</asp:Content>
OK, let's say the ActiveViewIndex is 1 so the 2nd tab (View) will be displayed on first load. When i click on the 3rd tab, the 'static content' is showed, but when i click on 1st tab (ID="Tab1") nothing is visible....On this first tab i have a form that must be filled. The same happens if, on first run, the ActiveViewIndex is 0, so the first tab is shown....when i click on the 2nd tba, nothing is visible...the second tab contains a GridView..so, it only happens on views that happens to contain a ContentPlaceHolder.
This is the code for content page of the first tab:
<%@ Page Language="C#" MasterPageFile="~/Tabs.mas
ter" AutoEventWireup="true" CodeFile="AddNew.aspx.cs" Inherits="AddNew" Title="Untitled Page" %>
<asp:Content ID="AddNewItemContent" ContentPlaceHolderID="addN
ewContent"
Runat="Server">
<table border="0" width="100%" height="100%">
<tr>
<td>
<h2>Add new data</h2>
</td>
</tr>
<tr>
<td>
<fieldset>
<legend>Fill the fields below</legend>
<table class='form'>
<colgroup>
<col />
<col />
</colgroup>
<tbody>
<tr>
<td class='label'>
<label>
<span class='required'>*</span>
Field 1:
</label>
</td>
<td class='input'>
<asp:TextBox runat="server" ID="field1" Columns="25" MaxLength="50" CssClass="i" />
<asp:RequiredFieldValidato
r ID="RequiredFieldValidator
1" runat="server" ControlToValidate="field1"
ErrorMessage="Mandatory" Display="None"/>
</td>
</tr>
<tr>
<td class='label'>
<label for='field2'>
<span class='required'>*</span>
Field 2:
</label>
</td>
<td class='input'>
<asp:TextBox runat="server" ID="field2" Columns="25" MaxLength="50" CssClass="i" />
<asp:RequiredFieldValidato
r ID="RequiredFieldValidator
2" runat="server" ErrorMessage="Mandatory field"
ControlToValidate="field2"
Display="None"></asp:Requi
redFieldVa
lidator>
</td>
</tr>
<tr>
<td class='label' style='height: 24px'>
<label for='field7'>Field 8:</label>
</td>
<td class='input' style='height: 24px'>
<asp:DropDownList ID="field8" runat="server">
<asp:ListItem Selected="true" Value="Yes">Yes</asp:ListI
tem>
<asp:ListItem Value="No">No</asp:ListIte
m>
</asp:DropDownList>
</td>
</tr>
</tbody>
</table>
</fieldset>
<asp:Button ID="btnAddNew" runat="server" BorderStyle='Ridge' Text='Adauga' Width='146px' OnClick='btnAddNew_Click'/
>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" Font-Bold="True" Font-Italic="True"
HeaderText="Errors on adding data:" Width="100%" />
</td>
</tr>
</table>
</asp:Content>
I'll also mention that i'm using ATLAS UpdatePanel in the content page for the second tab (With the GridView), but that has nothing to do with my problem....
Did you spot the mistake ? 'cause i didnt....
Thanks in advance...
View the Solution FREE for 30 Days