Share via


Type 'System.Web.UI.UpdatePanel' does not have a public property named 'DetailsView'

Question

Thursday, April 30, 2009 5:02 PM

 

 I want to use an AJAX update panel, but I am getting this error message. Below the error message is my .aspx code. Can anyone tell me what the problem is? In fact if I try and wrap my UpdatePanel tags around any specific control inside of the DetailsView tags, I get the same error message.

Server Error in '/EMR' Application.


Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Type 'System.Web.UI.UpdatePanel' does not have a public property named 'DetailsView'.

Source Error:

Line 34:     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
Line 35:  
Line 36:     <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
Line 37:         DataKeyNames="NoticeID" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
Line 38:         Height="50px" Width="381px"  GridLines="None" >

Source File: /EMR/Scream.aspx **   Line:** 36


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 <!-- [HttpException]: Type 'System.Web.UI.UpdatePanel' does not have a public property named 'DetailsView'. at System.Web.UI.ControlBuilder.GetChildPropertyBuilder(String tagName, IDictionary attribs, Type& childType, TemplateParser templateParser, Boolean defaultProperty) at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty) at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) [HttpParseException]: Type 'System.Web.UI.UpdatePanel' does not have a public property named 'DetailsView'. at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) [HttpParseException]: Type 'System.Web.UI.UpdatePanel' does not have a public property named 'DetailsView'. at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseReader(StreamReader reader, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse() at System.Web.UI.TemplateParser.Parse(ICollection referencedAssemblies, VirtualPath virtualPath) at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->

 

 

<%@ Page Title="" Language="VB" MasterPageFile="~/EMRMasterPage.master" AutoEventWireup="false" CodeFile="Scream.aspx.vb" Inherits="Scream" %>

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

<div id= "DivContent" >

<form id="form1" runat="server" class="controlaligner"

style="background-repeat: repeat-y; background-attachment: scroll; background-color: #FFFFEE; font-family: 'Times New Roman'; font-weight: lighter; font-style: normal;">

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:EMRConnectionString %>"

DeleteCommand="DELETE FROM [tblNotice] WHERE [NoticeID] = @NoticeID"

InsertCommand="Insert_Notice" InsertCommandType="StoredProcedure"

SelectCommand="SELECT [NoticeID], [NoticeTitle], [NoticeDescription], [RollCall], [Email], [SMS], [NoticeStartDate], [NoticeEndDate], [intUserID], [AdHocGroupID] FROM [tblNotice] WHERE ([intUserID] = @intUserID)"

UpdateCommand="UPDATE [tblNotice] SET [NoticeTitle] = @NoticeTitle, [NoticeDescription] = @NoticeDescription, [RollCall] = @RollCall, [Email] = @Email, [SMS] = @SMS, [NoticeStartDate] = @NoticeStartDate, [NoticeEndDate] = @NoticeEndDate, [intUserID] = @intUserID, [AdHocGroupID] = @AdHocGroupID WHERE [NoticeID] = @NoticeID">

<SelectParameters>

<asp:SessionParameter DefaultValue="6628" Name="intUserID"

SessionField="EmployeeID" Type="Int32" />

</SelectParameters>

<DeleteParameters>

<asp:Parameter Name="NoticeID" Type="Decimal" />

</DeleteParameters>

 

</asp:SqlDataSource>

<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:EMRConnectionString %>" SelectCommand="SELECT (tblUsers.txtFirstName + ' ' + tblUsers.txtLastName) AS Volt FROM tblUsers INNER JOIN

tblUser_ADHOC ON tblUsers.intUserID = tblUser_ADHOC.intUserID INNER JOIN

tblADHOC_Group ON tblADHOC_Group.AdHocGroupID = tblUser_ADHOC.AdHocGroupID

WHERE (tblADHOC_Group.AdHocGroupID =@AdHocGroupID)">

<SelectParameters>

<asp:ControlParameter ControlID="DetailsView1$ListBox1" DefaultValue=""

Name="AdHocGroupID" PropertyName="SelectedValue" />

</SelectParameters>

</asp:SqlDataSource>

<asp:ScriptManager ID="ScriptManager1" runat="server" ></asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

 

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="NoticeID" DataSourceID="SqlDataSource1" DefaultMode="Insert"

Height="50px" Width="381px" GridLines="None" >

<Fields>

 

<asp:TemplateField HeaderText="AdHocGroupID" SortExpression="AdHocGroupID">

<EditItemTemplate>

<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("AdHocGroupID") %>'></asp:TextBox>

</EditItemTemplate>

<InsertItemTemplate>

<asp:ListBox ID="ListBox1" runat="server" DataSourceID="SqlDataSource2" ItemStyle-Width="200" ControlStyle-Width="220"

DataTextField="AdHocGroupName" DataValueField="AdHocGroupID" AutoPostBack=true

SelectedValue='<%# Bind("AdHocGroupID") %>'></asp:ListBox>

</InsertItemTemplate>

<ItemTemplate>

<asp:Label ID="Label1" runat="server" Text='<%# Bind("AdHocGroupID") %>'></asp:Label>

</ItemTemplate>

<ControlStyle CssClass="field" />

<ItemStyle CssClass="field" />

</asp:TemplateField>

 

<asp:TemplateField HeaderText="Ad Hoc Users">

<InsertItemTemplate>

<asp:ListBox ID="ListBox2" runat="server" DataSourceID="SqlDataSource4" DataTextField="Volt" DataValueField="Volt" Width="232px"

onselectedindexchanged="ListBox2_SelectedIndexChanged">

</asp:ListBox>

</InsertItemTemplate>

</asp:TemplateField>

</Fields>

</asp:DetailsView>

</asp:UpdatePanel>

<div>

</div>

 

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:EMRConnectionString %>"

SelectCommand="SELECT [AdHocGroupID], [AdHocGroupName] FROM [tblADHOC_Group]">

</asp:SqlDataSource>

</form>

</div>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">

</asp:Content>

All replies (4)

Thursday, April 30, 2009 5:23 PM ✅Answered

Your details view should be wrapped inside the <contenttemplate> of the update panel

<asp:UpdatePanel ID="UpdatePanel1" runat="server>
     <ContentTemplate><CONTENTTEMPLATE>
           < Your DetailsView goes here >
    </ContentTemplate>
</asp:UpdatePanel></CONTENTTEMPLATE>

 


Friday, May 1, 2009 12:26 AM ✅Answered

You should put DetailsView inside <contenttemplate> of UpdatePanel

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="NoticeID" DataSourceID="SqlDataSource1" DefaultMode="Insert"

Height="50px" Width="381px" GridLines="None" >

</asp:DetailsView>

<ContentTemplate>

</asp:UpdatePanel>

http://www.asp.net/ajax/documentation/live/tutorials/IntroductionUpdatePanel.aspx


Friday, May 1, 2009 10:45 AM

Awesome guys,

Thanks!!!!


Thursday, July 26, 2012 12:25 AM

thz :)

it is really helpful to me :)