0

我对我的 aspx 页面进行了一些更改,现在它被呈现为空白。实际上它确实显示了包含其他所有内容的 div 标签。其他一切都是看不见的。有人可以指出导致问题的原因吗?继承人的HTML:

  <%@ Page StylesheetTheme="" Title="" Language="C#" MasterPageFile="~/Site.Master"
AutoEventWireup="true" CodeBehind="frmMyAccountMyProfile.aspx.cs" Inherits="WebApplication1.frmMyAccountMyProfile" %>

 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
 <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<script type="text/javascript">

    function CheckType(type) {
        document.getElementById("hdnfld").value = type;
        alert(document.getElementById("hdnfld").value);
        return false;
    }

    function confirmAction() {
        if (confirm('Are you sure, you want to delete?')) {
            // allow the form to post the data.  
            return true;
        }
        else {
            // disallow the form submission.  
            return false;
        }
    } 

</script>
<link href="Styles/myStyleSheet.css" rel="stylesheet" type="text/css" />
</asp:Content>

 <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<form action="">
<div class="divwrap">
    <table style="width: 100%; margin-right: 0px;">
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:TabContainer ID="TabContainer1" runat="server" CssClass="ajax__tab_lightblue-theme"
                    ActiveTabIndex="1">
                    <asp:TabPanel runat="server" HeaderText="My Profile" ID="tbpnlMyProfile">
                        <HeaderTemplate>
                            My Profile
                        </HeaderTemplate>
                        <ContentTemplate>
                            <table style="width: 100%;">
                                <tr>
                                    <td class="colwid colht">
                                        <asp:LinkButton ID="lnkBtnEditMyInfo" class="small-heading" runat="server" OnClick="lnkBtnEditMyInfo_Click">Edit My Info</asp:LinkButton>
                                    </td>
                                    &nbsp;
                                    <td>
                                        &nbsp;<asp:Label ID="lblFirstNameMyProfile" runat="server" Text="First Name"></asp:Label>
                                    </td>
                                    <td rowspan="3">
                                        <asp:Panel ID="pnlDisplay" runat="server">
                                            <table style="width: 100%;">
                                                &nbsp;
                                                <tr>
                                                    <td class="colht">
                                                        <asp:Label ID="lblMPDisplayFirstName" runat="server" Text="Label"></asp:Label>
                                                        &nbsp;
                                                        <br />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    &nbsp;
                                                    <td class="colht">
                                                        <asp:Label ID="lblMPDisplayLastName" runat="server" Text="Label"></asp:Label>
                                                        &nbsp;
                                                        <br />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    &nbsp;
                                                    <td class="colht">
                                                        <asp:Label ID="lblMPDisplayEmail" runat="server" Text="Label"></asp:Label>
                                                        &nbsp;
                                                        <br />
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                        &nbsp;
                                        <asp:Panel ID="pnlEditInfo" runat="server" Visible="False">
                                            <table style="width: 100%;">
                                                &nbsp;
                                                <tr>
                                                    <td class="colht">
                                                        <asp:TextBox ID="txtEditFirstName" runat="server"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                &nbsp;
                                                <tr>
                                                    <td class="colht">
                                                        <asp:TextBox ID="txtEditLastName" runat="server"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                &nbsp;
                                                <tr>
                                                    <td class="colht">
                                                        <asp:TextBox ID="txtEditEmail" runat="server"></asp:TextBox>
                                                    </td>
                                                </tr>
                                                &nbsp;
                                                <tr>
                                                    <td class="colht">
                                                        <asp:Button ID="btnEditInfoCancel" runat="server" CssClass="btndel" OnClick="btnEditInfoCancel_Click"
                                                            Text="Cancel" />
                                                        <asp:Button ID="btnEditInfoSave" runat="server" CssClass="btn" OnClick="btnEditInfoSave_Click"
                                                            Text="Save" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </td>
                                    &nbsp;
                                    <tr>
                                        <td class="colht">
                                            &nbsp;&nbsp;
                                        </td>
                                        &nbsp;
                                        <td class="">
                                            &nbsp;<asp:Label ID="lblLastNameMyProfile" runat="server" Text="Last Name"></asp:Label>
                                        </td>
                                    </tr>
                                    &nbsp;
                                    <tr>
                                        <td>
                                            &nbsp;&nbsp;
                                        </td>
                                        &nbsp;
                                        <td class="colht">
                                            &nbsp;<asp:Label ID="lblEmailMyProfile" runat="server" Text="Email"></asp:Label>
                                        </td>
                                        &nbsp;
                                        <tr>
                                            &nbsp;
                                            <td>
                                                <br />
                                            </td>
                                            &nbsp;
                                            <td>
                                                &nbsp;&nbsp;
                                            </td>
                                            <td>
                                            </td>
                                        </tr>
                                        &nbsp;
                                        <tr>
                                            <td>
                                                &nbsp;
                                                <asp:LinkButton ID="lnkbtnChangePassword" runat="server" class="small-heading">ChangePassword</asp:LinkButton>
                                                &nbsp; </strong>
                                            </td>
                                            <td>
                                                &nbsp;
                                                <asp:LinkButton ID="lnkChangePassword" runat="server" OnClick="lnkChangePassword_Click">Click here to change your password</asp:LinkButton>
                                                &nbsp;
                                                <br />
                                                <asp:Panel ID="pnlChangePassword" runat="server" CausesValidation="False" Visible="False">
                                                    &nbsp;
                                                    <table style="width: 100%;">
                                                        <tr>
                                                            &nbsp;
                                                            <td class="">
                                                            </td>
                                                            <td style="width: 150px">
                                                                <asp:Label ID="lblOldPassword" runat="server" CssClass="lbl2" Text="Old Password"></asp:Label>
                                                            </td>
                                                            &nbsp;
                                                            <td class="">
                                                                <asp:TextBox ID="txtOldPassword" runat="server" CssClass="txtbx2" TextMode="Password"></asp:TextBox>
                                                            </td>
                                                            &nbsp;
                                                            <td class="">
                                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtOldPassword"
                                                                    ErrorMessage="Please enter password!"></asp:RequiredFieldValidator>
                                                                &nbsp;
                                                            </td>
                                                        </tr>
                                                        &nbsp;
                                                        <tr>
                                                            <td class="">
                                                            </td>
                                                            &nbsp;
                                                            <td class="">
                                                                <asp:Label ID="lblNewPassword" runat="server" CssClass="lbl2" Text="New Password"></asp:Label>
                                                            </td>
                                                            &nbsp;
                                                            <td class="">
                                                                <asp:TextBox ID="txtNewPassword" runat="server" CssClass="txtbx2" TextMode="Password"></asp:TextBox>
                                                            </td>
                                                            &nbsp;
                                                            <td class="">
                                                                &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtNewPassword"
                                                                    ErrorMessage="Please choose new password!"></asp:RequiredFieldValidator>
                                                            </td>
                                                        </tr>
                                                        &nbsp;
                                                        <tr>
                                                            <td>
                                                            </td>
                                                            &nbsp;
                                                            <td class="">
                                                                <asp:Label ID="lblConfirmPassword" runat="server" CssClass="lbl2" Text="ConfirmPassword"></asp:Label>
                                                            </td>
                                                            &nbsp;
                                                            <td>
                                                                <asp:TextBox ID="txtConfirmPassword" runat="server" CssClass="txtbx2" TextMode="Password"></asp:TextBox>
                                                            </td>
                                                            &nbsp;
                                                            <td>
                                                                <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtNewPassword"
                                                                    ControlToValidate="txtConfirmPassword" ErrorMessage="CompareValidator"></asp:CompareValidator>
                                                            </td>
                                                        </tr>
                                                        &nbsp;
                                                        <tr>
                                                            <td>
                                                            </td>
                                                            &nbsp;
                                                            <td class="">
                                                                <asp:Button ID="btnCancel1" runat="server" CausesValidation="False" CssClass="btndel"
                                                                    OnClick="btnCancel1_Click1" Text="Cancel" Width="60px" />
                                                            </td>
                                                            <td>
                                                                &nbsp;
                                                                <asp:Button ID="btnSaveNewPassword" runat="server" CssClass="btn" OnClick="btnSaveNewPassword_Click"
                                                                    Text="Save" />
                                                            </td>
                                                            &nbsp;
                                                            <td>
                                                            </td>
                                                        </tr>
                                                        &nbsp;
                                                        <tr>
                                                            <td>
                                                            </td>
                                                            &nbsp;
                                                            <td class="">
                                                            </td>
                                                            &nbsp;
                                                            <td>
                                                            </td>
                                                            <td>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </asp:Panel>
                                            </td>
                                            &nbsp;
                                            <td>
                                                &nbsp;&nbsp;
                                            </td>
                                        </tr>
                                        &nbsp;
                                        <br />
                                        &nbsp;
                                        <br />
                                        <tr>
                                            <td>
                                                &nbsp;&nbsp;
                                            </td>
                                            <td colspan="2">
                                                <br />
                                            </td>
                                        </tr>
                                        &nbsp;
                                        <tr>
                                            <td>
                                                &nbsp;<asp:LinkButton ID="lnkbtnEditContactNo" runat="server" class="small-heading"
                                                    OnClick="lnkbtnEditContactNo_Click">Edit Contact No.</asp:LinkButton>
                                                &nbsp;&nbsp;
                                            </td>
                                            &nbsp;
                                            <td colspan="2">
                                                &nbsp;<asp:Label ID="lblDisplayContactNo" runat="server" Text="Label"></asp:Label>
                                                <asp:Panel ID="pnlEditContactNo" runat="server" Visible="False">
                                                    &nbsp;
                                                    <asp:DropDownList ID="ddlEditCountryNameCode" runat="server" CssClass="ddl2" OnSelectedIndexChanged="ddlEditCountryNameCode_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                    &nbsp;&nbsp;<asp:TextBox ID="txtEditMobile" runat="server" CssClass="txtbx2"></asp:TextBox>
                                                    &nbsp;
                                                    <br />
                                                    <asp:Button ID="btnCancel" runat="server" CssClass="btndel" OnClick="btnCancel_Click"
                                                        Text="Cancel" />
                                                    &nbsp;<asp:Button ID="btnSave" runat="server" CssClass="btn" OnClick="btnSave_Click"
                                                        Text="Save" />
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                    </tr>
                                </tr>
                            </table>
                        </ContentTemplate>
                    </asp:TabPanel>
                    <asp:TabPanel ID="tbpnlAddressbook" runat="server" HeaderText="Addressbook">
                        <HeaderTemplate>
                            Addressbook
                        </HeaderTemplate>
                        <ContentTemplate>
                            <table style="width: 100%;">
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;<asp:LinkButton ID="lnkbtnViewChange" runat="server" class="small-heading">View / Change</asp:LinkButton>
                                    </td>
                                    <td>
                                        &nbsp;<asp:DropDownList ID="ddlName" runat="server" AutoPostBack="True" CssClass="ddl2"
                                            OnSelectedIndexChanged="ddlName_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        <div>
                                            &nbsp;&nbsp;<asp:Label ID="lblDisplayFirstName" runat="server" Text="Label"></asp:Label>
                                            &nbsp;<asp:Label ID="lblDisplayLastName" runat="server" Text="Label"></asp:Label>
                                            &nbsp;
                                            <br />
                                            &nbsp;&nbsp;<asp:Label ID="lblDisplayAddressLine1" runat="server" Text="Label"></asp:Label>
                                            <br />
                                            &nbsp;&nbsp;<asp:Label ID="lblDisplayAddressLine2" runat="server" Text="Label"></asp:Label>
                                            <asp:Label ID="lblDisplayAddressLine3" runat="server" Text="Label"></asp:Label>

              <asp:Label ID="lblDisplayCity" runat="server" Text="Label"></asp:Label>
                                            <br />
                                            &nbsp;
                                            <asp:Label ID="lblDisplayState" runat="server" Text="Label"></asp:Label>
                                            <br />
                                            &nbsp;
                                            <asp:Label ID="lblDisplayCountry" runat="server" Text="Label"></asp:Label>
                                            <br />
                                            &nbsp;
                                            <asp:Label ID="lblDisplayPostalCode" runat="server" Text="Label"></asp:Label>
                                            <br />
                                            &nbsp;
                                            <asp:Button ID="btnEdit" runat="server" CssClass="roundcorner btn" OnClick="btnEdit_Click"
                                                OnClientClick="return CheckType('Edit');" Text="Edit" 
                                                CausesValidation="False" />

                                            <asp:ModalPopupExtender ID="btnEdit_ModalPopupExtender" runat="server" 
                                                DynamicServicePath="" Enabled="True" TargetControlID="btnDummy" PopupControlID="pnlMyAddressBook"  BackgroundCssClass="modalBackground roundcorner">
                                            </asp:ModalPopupExtender>

                                            <asp:Button ID="btnDelete" runat="server" CssClass="btndel" OnClick="btnDelete_Click1"
                                                OnClientClick="javascript: return confirmAction()" Text="Delete" />
                                            <asp:Button ID="btnDummy" runat="server" Text="Dummy" Visible="False" /></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;<asp:LinkButton ID="lnkbtnAddNewAddress" runat="server" 
                                            CausesValidation="False" onclick="lnkbtnAddNewAddress_Click1">AddNewAddress</asp:LinkButton>

                                        <asp:ModalPopupExtender ID="lnkbtnAddNewAddress_ModalPopupExtender" 
                                            runat="server" DynamicServicePath="" Enabled="True" 
                                            TargetControlID="lnkbtnAddNewAddress"  PopupControlID="btnDummy" BackgroundCssClass="modalBackground roundcorner">
                                        </asp:ModalPopupExtender>

                                    </td>
                                </tr>
                            </table>
                            <div class="divwrap">
                                <asp:Panel ID="pnlMyAddressBook" runat="server" BackColor="White" 
                                    CssClass="roundcorner" Visible="False">

                                </asp:Panel>
                            </div>
                            <asp:RoundedCornersExtender ID="pnlMyAddressBook_RoundedCornersExtender" runat="server"
                                Enabled="True" TargetControlID="pnlMyAddressBook">
                            </asp:RoundedCornersExtender>

                            </table>
                        </ContentTemplate>
                    </asp:TabPanel>

                </asp:TabContainer>
               <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                </asp:ToolkitScriptManager>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        </table>
    <asp:HiddenField ID="hdnfld" runat="server" />
</div>
</form>
 </asp:Content>

.divwrap
{
padding: 3%;
display: inline-block;
margin: 3%;
border: 1px solid #66CCFF;
vertical-align: middle;
width: auto;
position: relative;
 }
4

1 回答 1

0

我知道这是一个旧线程,但对我来说是这样工作的:

  • 检查任何控制验证是否设置了正确的 ID。例如:如果您有验证器检查错误的 ID,则页面不会呈现;
  • 一些服务器端控件需要用初始标记关闭。例如:......如果你关闭它会出现一些控制错误(根据我的经验);
  • 不良的头部标签;
  • 如果您看到页面的来源,可能是一个糟糕的 css;
  • .divwarp 在标签内吗?
  • 工具包必须位于页面顶部
于 2015-03-30T16:42:36.717 回答