我设计了一个用户控件但其设计视图不可见,任何人都可以帮助我。
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Note.ascx.cs" Inherits="MFActivityPlanning.usercontrols_Note" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register TagPrefix="uc" TagName="UserThumbNail" Src="~/usercontrols/UserThumbNail.ascx" %>
<script language="javascript" type="text/javascript">
// Trims the blank space from the start and end of string
function Trim(objValue) {
var lRegExp = /^\s*/;
var rRegExp = /\s*$/;
objValue = objValue.replace(lRegExp, ""); //Perform LTRim
objValue = objValue.replace(rRegExp, ""); //perform RTrim
return objValue;
}
//Check for special characters
function ValidateString(inputText) {
if (inputText.match(/[<>]/)) {
return false;
}
if (inputText.match(/(&#)/)) {
return false;
}
return true;
}
</script>
<style type="text/css">
.cal_Theme .ajax__calendar_container
{
background-color: #ffffff;
border: solid 1px #cccccc;
}
.cal_Theme .ajax__calendar_title
{
border: none;
}
</style>
<asp:UpdatePanel ID="upPnlNotes" runat="server">
<ContentTemplate>
<asp:HiddenField ID="hdnCurrentObjectID" runat="server" />
<div align="center">
<asp:UpdateProgress ID="upProgNotes" AssociatedUpdatePanelID="upPnlNotes" DynamicLayout="true"
runat="server">
<ProgressTemplate>
<div align="center">
<div align="center" class="waitMessageStyle">
</div>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<cc1:AlwaysVisibleControlExtender TargetControlID="upProgNotes" ID="AlwaysVisibleControlExtender1"
runat="server" UseAnimation="true" HorizontalSide="Center" HorizontalOffset="1">
</cc1:AlwaysVisibleControlExtender>
</div>
<table width="94%">
<tr>
<td colspan="2">
<asp:Label ID="lblError" runat="server" CssClass="diaryLinkStatusStyle"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:TextBox ID="txtNote" runat="server" Width="99%" TextMode="MultiLine" Font-Names="Arial"
MaxLength="4000" Rows="4"></asp:TextBox>
</td>
</tr>
<tr>
<td align="left" width="35%">
<asp:Button ID="btnAddNote" runat="server" Text="Add Note" CssClass="btnStyle" OnClick="btnAddNote_Click">
</asp:Button>
<asp:Label ID="lblCharacterLeft" runat="server" Text="4000 remains" CssClass="lblStyle"
Style="color: Gray;"></asp:Label>
</td>
<td align="right" width="65%" style="vertical-align: bottom;">
<asp:Label ID="lblFilterMsg" runat="server" CssClass="noteTimeStampStyle" />
<asp:ImageButton ID="ibtnCancelFilter" runat="server" Visible="false" ImageUrl="~/Images/cancel_filter.png"
OnClick="ibtnCancelFilter_Click" ToolTip="Clear Filter" />
<asp:Image ID="imgFilter" runat="server" ImageUrl="~/Images/filter.png" Visible="false"
ToolTip="Filter Notes" Style="cursor: pointer;" />
<cc1:ModalPopupExtender ID="imgFilter_ModalPopupExtender" runat="server" TargetControlID="imgFilter"
PopupControlID="pnlFilter" BackgroundCssClass="modalPopupBackgroundStyle" DropShadow="True"
CancelControlID="ibtnCloseFilter">
</cc1:ModalPopupExtender>
<asp:Panel ID="pnlFilter" runat="server" Style="display: none" BackColor="Window"
BorderStyle="Groove" BorderWidth="2px" CssClass="pnlFilter">
<table cellspacing="2" cellpadding="2">
<tr>
<td colspan="2" bgcolor="Gray">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="right" style="width: 20px">
</td>
<td align="center">
<asp:Label ID="lblPopupHeading" runat="server" Text="Filter Notes" CssClass="lblStyle"
Font-Bold="true" ForeColor="White" />
</td>
<td align="right" style="width: 20px">
<asp:ImageButton ID="ibtnCloseFilter" runat="server" ImageUrl="~/Images/close.png" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblNoteBy" runat="server" CssClass="lblStyle" Text="Note by: " />
</td>
<td align="left">
<asp:DropDownList ID="ddlNoteBy" runat="server" Width="200" AppendDataBoundItems="true"
CssClass="btnStyle">
</asp:DropDownList>
<asp:HiddenField ID="hdnNoteBy" runat="server" />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDateBefore" runat="server" CssClass="lblStyle" Text="Added before: " />
</td>
<td align="left">
<asp:TextBox ID="txtDtBefore" runat="server" BackColor="Yellow" BorderWidth="0px"
Width="80px" Text="Select a date" />
<asp:ImageButton ID="ibtnCalbefore" runat="server" ImageUrl="~/Images/calendar.gif" />
<cc1:CalendarExtender ID="txtDtBefore_CalendarExtender" runat="server" Enabled="True"
TargetControlID="txtDtBEfore" PopupButtonID="ibtnCalbefore" Format="MM-dd-yyyy"
CssClass="cal_Theme">
</cc1:CalendarExtender>
<asp:HiddenField ID="hdnDtBefore" runat="server" />
<asp:ImageButton ID="ibtnClrDtBefore" runat="server" ToolTip="Clear date" ImageUrl="~/Images/clear_field.png" />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDtAfter" runat="server" CssClass="lblStyle" Text="Added after: " />
</td>
<td align="left">
<asp:TextBox ID="txtDtAfter" runat="server" BackColor="Yellow" BorderWidth="0px"
Width="80px" Text="Select a date" />
<asp:ImageButton ID="ibtnCalAfter" runat="server" ImageUrl="~/Images/calendar.gif" />
<cc1:CalendarExtender ID="txtDtAfter_CalendarExtender" runat="server" Enabled="True"
TargetControlID="txtDtAfter" PopupButtonID="ibtnCalAfter" Format="MM-dd-yyyy"
CssClass="cal_Theme">
</cc1:CalendarExtender>
<asp:HiddenField ID="hdnDtAfter" runat="server" />
<asp:ImageButton ID="ibtnClrDtAfter" runat="server" ToolTip="Clear date" ImageUrl="~/Images/clear_field.png" />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblSearchby" runat="server" CssClass="lblStyle" Text="Search by: " />
</td>
<td align="left">
<asp:TextBox ID="txtFilter" runat="server" Width="180" CssClass="txtStyle" />
<cc1:TextBoxWatermarkExtender ID="txtFilter_TextBoxWatermarkExtender" runat="server"
Enabled="True" TargetControlID="txtFilter" WatermarkText="Filter Expression"
WatermarkCssClass="WaterMarkStyle">
</cc1:TextBoxWatermarkExtender>
<asp:HiddenField ID="hdnFilterSearch" runat="server" />
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:Button ID="btnApply" runat="server" Text="Apply" CssClass="btnStyle" OnClick="btnApply_Click" />
<asp:Button ID="btnCancel" runat="server" Text="Clear" CssClass="btnStyle" OnClick="btnCancel_Click" />
</td>
</tr>
</table>
</asp:Panel>
<asp:Label ID="lblPageSize" runat="server" CssClass="lblStyle" ForeColor="Gray" Text="Page Size:"></asp:Label>
<asp:DropDownList ID="ddlPageSize" Width="50px" runat="server" AutoPostBack="True"
Font-Size="X-Small" ForeColor="Gray" OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<asp:ListItem>15</asp:ListItem>
<asp:ListItem>25</asp:ListItem>
<asp:ListItem>50</asp:ListItem>
</asp:DropDownList>
<asp:ImageButton runat="server" ID="ibtnRefreshNoteList" ImageUrl="~/Images/refresh.png"
ToolTip="Refresh List" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:ListView ID="lvNoteList" runat="server" OnPreRender="lvNoteList_PreRender" OnItemDataBound="lvNoteList_ItemDataBound">
<LayoutTemplate>
<div>
<asp:PlaceHolder ID="itemPlaceholderContainer" runat="server"></asp:PlaceHolder>
<asp:Panel ID="itemPlaceholder" runat="server">
</asp:Panel>
</div>
</LayoutTemplate>
<ItemTemplate>
<table width="100%" cellpadding="0" cellspacing="0" style="vertical-align: top; "
class="<%# Container.DisplayIndex % 2 == 0 ? "" : "noteListAlternetLine" %>">
<tr>
<td width="55px" align="center" valign="top" id="tdUserThumbnail" runat="server">
<uc:UserThumbNail ID="ucThumbNail" runat="server" PhotoSize="Small" PhotoWeight="Low"
ShowEdit="false" ShowName="False" ShowEmailID="true" IsUseExternalData="true" />
</td>
<td valign="top" align="left">
<div class="noteHeaderStyle">
by
<asp:HyperLink ID="addMember" runat="server" Font-Underline="True">
</asp:HyperLink>
<asp:Label ID="Time" runat="server" CssClass="noteTimeStampStyle" Text='<%#FormatNoteTime(Convert.ToDateTime(Eval("CREATED_ON")))%>'
ToolTip='<%# "Added On: " + Eval("CREATED_ON")%>'>
</asp:Label>
</div>
<div id="note" runat="server" class="noteTextStyle">
<%#ParseExternalLinks(Convert.ToString(Eval("NOTE")).ToString().Replace("\n", "<br/>"))%></div>
</td>
</tr>
</table>
</ItemTemplate>
</asp:ListView>
<asp:DataPager ID="dpNoteList" runat="server" PageSize="15" PagedControlID="lvNoteList">
<Fields>
<asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="true" ShowNextPageButton="false"
ShowPreviousPageButton="false" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="true" ShowNextPageButton="false"
ShowPreviousPageButton="false" />
</Fields>
</asp:DataPager>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
答案 0 :(得分:0)
尝试再次重新创建用户控件,这次逐渐添加控件并定期查看设计视图。有些时候你会知道哪个控件导致了这个问题。