Ir para conteúdo
Fórum Script Brasil
  • 0

Dúvidas com Master page


devhtml

Pergunta

Olá pessoal!

Gostaria de uma ajuda:

1) tenho uma página WebForm4 100% correta, onde ela é ajustada ao tamanho da tela, veja código:

%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication1.WebForm4" %>

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<style type="text/css">
    html, body 
    {
        height: 100%;
        margin: 0;
        padding: 0;
    }

</style>
</head>

<body bgcolor="Black">

 <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; height: 100%" >
     <tr>

        <!--Space-->
        <td width="20">&nbsp;</td>

        <!--Menu left image-->
        <td align="right" >&nbsp;</td>

        <!--Menu center image #055483-->
        <td align="left">

               <table cellpadding="0" cellspacing="0" border="0"  style="width: 100%; height: 100%">
  
                    <tr style="height: 10px">
                      <td width="50" height="30"></td>
                      <td align="right" bgcolor="#127DAB" style="background-image: url('../Images/Left.png'); background-repeat: no-repeat; height: 30px; width: 5px;">&nbsp;</td>
                      <td align="right" bgcolor="#127DAB" style="background-image: url('../Images/center.png'); background-repeat: repeat-x; height: 30px; width: 100%;">&nbsp;</td>
                      <td align="left" bgcolor="#127DAB" style="background-image: url('../Images/Right.png'); background-repeat: no-repeat; height: 30px; width: 5px;">&nbsp;</td>
                      <td width="50" height="30"></td>
                    </tr>
    
                    <tr style="height: 10px">
                      <td width="50" height="30"></td>
                      <td width="5" height="30" align="center" bgcolor="#127DAB"  >&nbsp;</td>
                      <td width="100" height="30" bgcolor="#127DAB"></td>
                      <td width="5" height="30" align="center" bgcolor="#127DAB"  >&nbsp;</td>
                      <td width="50" height="30"></td>
                    </tr>
    

                    <tr>
                      <td width="50" height="30"></td>
                      <td width="5" height="30" align="center" bgcolor="#127DAB">&nbsp;</td>
                      <td width="100" height="30" bgcolor="#127DAB"></td>
      
                      <td width="5" height="30" align="center" bgcolor="#127DAB">&nbsp;</td>
                      <td width="50" height="30"></td>
                    </tr>
    
            </table>
      </td>

        <!--Menu right image-->
        <td align="left" >&nbsp;</td>

        <!--Space-->
        <td width="20">&nbsp;</td>

   </tr>

    <tr>
        <td colspan="5"></td>
    </tr>

</table>

</body>
</html>
2) Porém, precisei colocá-la em masterPage, veja código da Master Page, simples, só com um menu:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="WebApplication1.Site1" %>

<!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 runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</head>

<body bgcolor="#99ff99">
    <form id="form1" runat="server">
    <div>

        <table cellspacing="1" class="style1">
            <tr>
                <td>Esta é a master Page, topo!!</td>
            </tr>
        </table>
        <br />


        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>
3) Colocando a WebForm4 dentro da Master page, a tabela não fica mais 100 de altura. Como fazer isso, já que tinha um código dentro da WebForm4 e que para colocá-la dentro de uma master, precisou ser removido. Veja código WebForm4 como ficou:
<%@ Page Language="C#"  MasterPageFile="/Site1.master" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="WebApplication1.WebForm4" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

 <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; height: 100%" >
     <tr>

        <!--Space-->
        <td width="20">&nbsp;</td>

        <!--Menu left image-->
        <td align="right" >&nbsp;</td>

        <!--Menu center image-->
        <td align="left">

               <table cellpadding="0" cellspacing="0" border="0"  style="width: 100%; height: 100%">
  
                <tr style="height: 10px">
                  <td width="50" height="30"></td>
                  <td align="right" bgcolor="#127DAB" style="background-image: url('../Images/Left.png'); background-repeat: no-repeat; height: 30px; width: 5px;">&nbsp;</td>
                  <td align="right" bgcolor="#127DAB" style="background-image: url('../Images/center.png'); background-repeat: repeat-x; height: 30px; width: 100%;">&nbsp;</td>
                  <td align="left" bgcolor="#127DAB" style="background-image: url('../Images/Right.png'); background-repeat: no-repeat; height: 30px; width: 5px;">&nbsp;</td>
                  <td width="50" height="30"></td>
                </tr>
    
                <tr style="height: 10px">
                  <td width="50" height="30"></td>
                  <td width="5" height="30" align="center" bgcolor="#127DAB"  >&nbsp;</td>
                  <td width="100" height="30" bgcolor="#127DAB"></td>
                  <td width="5" height="30" align="center" bgcolor="#127DAB"  >&nbsp;</td>
                  <td width="50" height="30"></td>
                </tr>
    

                <tr>
                  <td width="50" height="30"></td>
                  <td width="5" height="30" align="center" bgcolor="#127DAB">&nbsp;</td>
                  <td width="100" height="30" bgcolor="#127DAB"></td>
      
                  <td width="5" height="30" align="center" bgcolor="#127DAB">&nbsp;</td>
                  <td width="50" height="30"></td>
                </tr>
    
  </table>
        </td>

        <!--Menu right image-->
        <td align="left" >&nbsp;</td>

        <!--Space-->
        <td width="20">&nbsp;</td>

   </tr>

    <tr>
        <td colspan="5"></td>
    </tr>

</table>

</asp:Content>

Editado por kuroi
Adicionar tag CODE
Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...