[RESOLVED]System.Web.UI.ScriptManager' does not have a public property named 'Button'

i try to show ssrsc reports in asp.net web page and for this i search tutorials and i find tutorials which shows me add script manager ,reportviewer and a button when i add these 3 things in my project in .aspx page and then when i debug my project then
it shows me error and here i clear that i can not add ajax tool kit reigster assembly in .aspx page for this how i add register assebly for ajax code

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div align ="center" class="adminform">
<br /><br />
        <center>
        <div class="vpb_main_wrapper"  align="center" style="left: inherit"/><br clear="all"/>
            <asp:ScriptManager ID="ScriptManager1" runat="server">

          <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />

            <rsweb:ReportViewer ID="ReportViewer2" runat="server" Height="261px"
                Width="476px">
            </rsweb:ReportViewer>
               </asp:ScriptManager>
    </center>
    </div>

</asp:Content>

Error

Type 'System.Web.UI.ScriptManager' does not have a public property named 'Button'.

Source Error:


Line 11:             <asp:ScriptManager ID="ScriptManager1" runat="server">
Line 12:
Line 13:           <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
Line 14:
Line 15:             <rsweb:ReportViewer ID="ReportViewer2" runat="server" Height="261px"

Hi,

You have added controls inside your script manager and thats the reason for this error.

You need to change your from 

<asp:ScriptManager ID="ScriptManager2" runat="server">
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
            <rsweb:reportviewer id="ReportViewer2" runat="server" height="261px" width="476px">
            </rsweb:reportviewer>
        </asp:ScriptManager>

to

 <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
        <rsweb:reportviewer id="ReportViewer2" runat="server" height="261px" width="476px">
        </rsweb:reportviewer>

and this will resolve your issue.

Your code shold look like

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<rsweb:ReportViewer ID="ReportViewer2" runat="server" Height="261px" Width="476px">
</rsweb:ReportViewer>

Leave a Reply