Advertisement

[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

09/11/2006 at 02:21AM PDT, ID: 21984564
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Content of Master Page Not visible in MultiView

Asked by olivboy in Programming for ASP.NET

Tags: multiview, contentplaceholder, master



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="~/MasterPage.master" AutoEventWireup="true" CodeFile="Tabs.master.cs" Inherits="Tabs" %>
<asp:Content ID="tabContent" ContentPlaceHolderID="mainContentPlaceHolder" Runat="Server">
    <asp:Menu ID="Menu1" Width="190px" runat="server" CssClass="tabs" Orientation="Horizontal" StaticMenuItemStyle-CssClass="tab" StaticSelectedStyle-CssClass="selectedTab" OnMenuItemClick="Menu1_MenuItemClick">
        <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.master" AutoEventWireup="true" CodeFile="AddNew.aspx.cs" Inherits="AddNew" Title="Untitled Page" %>
<asp:Content ID="AddNewItemContent" ContentPlaceHolderID="addNewContent" 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:RequiredFieldValidator ID="RequiredFieldValidator1" 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:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Mandatory field"
                                               ControlToValidate="field2" Display="None"></asp:RequiredFieldValidator>

                                        </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:ListItem>
                                            <asp:ListItem Value="No">No</asp:ListItem>
                                      </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>
    &nbsp; &nbsp;&nbsp;
</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
[+][-]09/11/06 07:21 AM, ID: 17494736

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Programming for ASP.NET
Tags: multiview, contentplaceholder, master
Sign Up Now!
Solution Provided By: aki4u
Participating Experts: 1
Solution Grade: A
 
 
[+][-]10/18/06 02:38 PM, ID: 17761146

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]10/22/06 07:13 PM, ID: 17786134

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090429-EE-VQP-58