Results 1 to 7 of 7

Thread: ScriptManager is required on the page to use ASP.NET AJAX Script Components

  1. #1

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    ScriptManager is required on the page to use ASP.NET AJAX Script Components

    ---------------------------------------------------------------
    My page contains a scriptmanager and updatepanel.
    What I would like to do is when user click on the checkbox within the gridview which is embeded inside a updatepanel. The gridview will changed the editindex into particular selected row index.

    My code is here :

    vb Code:
    1. Protected Sub chkSelect_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
    2.         If IsPostBack Then
    3.             Dim cb As CheckBox = DirectCast(sender, CheckBox)
    4.             If cb IsNot Nothing Then
    5.                 If cb.Checked Then
    6.                     Dim row As GridViewRow = DirectCast(cb.NamingContainer, GridViewRow)
    7.                     Dim index As Integer = row.RowIndex
    8.                     With grdListOfItem
    9.                         .EditIndex = index
    10.                         .DataSource = (CType(Session("myDatatable3"), DataTable)).DefaultView
    11.                         .DataBind()
    12.                     End With
    13.                 End If
    14.             End If
    15.         End If
    16.     End Sub

    asp Code:
    1. <asp:TemplateField>
    2.                 <HeaderTemplate>
    3.                     <asp:CheckBox ID="chkHeader" runat="server"  />
    4.                 </HeaderTemplate>
    5.                 <ItemTemplate>
    6.                     <asp:CheckBox ID="chkSelect" runat="server"  AutoPostBack = "true" OnCheckedChanged = "chkSelect_CheckedChanged"/>
    7.                 </ItemTemplate>
    8.             </asp:TemplateField>

    But I get an error on .databind()
    ---------------------
    System.InvalidOperationException was unhandled by user code Message="A ScriptManager is required on the page to use ASP.NET AJAX Script Components." Source="AjaxControlToolkit"
    Hope someone can help me. Thanks a lot.
    Last edited by nUflAvOrS; Mar 23rd, 2009 at 11:22 PM.
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: ScriptManager is required on the page to use ASP.NET AJAX Script Components

    Form the Error msg I Could see that your page doent contain the script manager

    Can you check it ?
    Please mark you thread resolved using the Thread Tools as shown

  3. #3

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: ScriptManager is required on the page to use ASP.NET AJAX Script Components

    I have a scriptmanager within the page.

    thanks danasegarane
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  4. #4
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: ScriptManager is required on the page to use ASP.NET AJAX Script Components

    Could you please post the script manager tag from the design ?
    Please mark you thread resolved using the Thread Tools as shown

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: ScriptManager is required on the page to use ASP.NET AJAX Script Components

    Your UpdatePanel and its contents too, please!

  6. #6

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: ScriptManager is required on the page to use ASP.NET AJAX Script Components

    Thanks guys,

    here we go :-)

    vb Code:
    1. <asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    2.     <cc1:ScriptManager ID="ScriptManager1" runat="server">
    3.     </cc1:ScriptManager>
    4.     &nbsp;<br />
    5.    
    6.  
    7.  
    8.     <br />
    9.    
    10.     <div>
    11.     <table id="Table2" cellSpacing=1 cellPadding=0 border=0 runat="server">
    12.     <tr>
    13.         <td vAlign=top align=left colspan="4">
    14.             <asp:Image id="imgHeader" runat="server" Width="700px" ImageUrl="~/Images/Header.png"></asp:Image>
    15.         </td>
    16.     </tr>
    17.     <tr>
    18.         <td style="WIDTH: 60px; height: 20px;" vAlign=top align=left>
    19.  
    20.             &nbsp;&nbsp;<asp:Label id="lblIssue" runat="server" Width="80px" ForeColor="Navy" Text="Issue Number" Font-Size="10pt"></asp:Label>
    21.         </td>
    22.         <td style="WIDTH: 200px; HEIGHT: 20px" vAlign=top align=left >
    23.             &nbsp;&nbsp;<asp:DropDownList ID="ddlIssueNum" runat="server" Width="176px">
    24.             </asp:DropDownList>
    25.         </td>
    26.     </tr>
    27.     <tr>
    28.         <td vAlign=top align=left colspan="4">
    29.             <br />  
    30.             <asp:Image id="imgHeader1" runat="server" Width="700px" ImageUrl="~/Images/ReqInfo.png"></asp:Image>
    31.  
    32.         </td>
    33.     </tr>
    34.     <tr>
    35.         <td style="WIDTH: 60px; height: 20px;" vAlign=top align=left>
    36.             &nbsp;&nbsp;<asp:Label id="lblAID" runat="server" Width="100px" ForeColor="Navy" Text="Authorized ID" Font-Size="10pt"></asp:Label>
    37.         </td>
    38.         <td style="WIDTH: 200px; HEIGHT: 20px" vAlign=top align=left >
    39.             &nbsp;&nbsp;<asp:TextBox id="txtAID" runat="server"></asp:TextBox>
    40.         </td>
    41.         <td style="WIDTH: 60px; height: 20px;" vAlign=top align=left>
    42.             &nbsp;&nbsp;<asp:Label id="lblName" runat="server" Width="100px" ForeColor="Navy" Text="Name" Font-Size="10pt"></asp:Label>
    43.         </td>
    44.         <td style="WIDTH: 200px; HEIGHT: 20px" vAlign=top align=left >
    45.             &nbsp;&nbsp;<asp:TextBox id="txtName" runat="server"></asp:TextBox>
    46.         </td>
    47.     </tr>
    48.     <tr>
    49.         <td style="WIDTH: 60px; height: 20px;" vAlign=top align=left>
    50.             &nbsp;&nbsp;<asp:Label id="lblDesign" runat="server" Width="100px" ForeColor="Navy" Text="Designation" Font-Size="10pt"></asp:Label>
    51.         </td>
    52.         <td style="WIDTH: 200px; HEIGHT: 20px" vAlign=top align=left >
    53.             &nbsp;&nbsp;<asp:DropDownList id="ddlDesign" runat="server" Width="88px"></asp:DropDownList>
    54.         </td>
    55.         <td style="WIDTH: 60px; height: 20px;" vAlign=top align=left>
    56.             &nbsp;&nbsp;<asp:Label id="lblCC" runat="server" Width="100px" ForeColor="Navy" Text="CC" Font-Size="10pt"></asp:Label>
    57.         </td>
    58.         <td style="WIDTH: 200px; HEIGHT: 20px" vAlign=top align=left >
    59.             &nbsp;&nbsp;<asp:DropDownList id="ddlCC" runat="server" Width="88px"></asp:DropDownList>
    60.         </td>
    61.     </tr>
    62.     <tr>
    63.         <td style="WIDTH: 60px; height: 20px;" vAlign=top align=left>
    64.             &nbsp;&nbsp;<asp:Label id="lblSubCon" runat="server" Width="100px" ForeColor="Navy" Text="Sub Con" Font-Size="10pt"></asp:Label>
    65.         </td>
    66.         <td style="WIDTH: 200px; HEIGHT: 20px" vAlign=top align=left >
    67.             &nbsp;&nbsp;<asp:DropDownList id="ddlSubCon" runat="server" Width="88px"></asp:DropDownList>
    68.         </td>
    69.         <td style="WIDTH: 60px; height: 20px;" vAlign=top align=left>
    70.             &nbsp;&nbsp;<asp:Label id="lblSubConName" runat="server" Width="100px" ForeColor="Navy" Text="Sub-Con Name" Font-Size="10pt"></asp:Label>
    71.         </td>
    72.         <td style="WIDTH: 200px; HEIGHT: 20px" vAlign=top align=left >
    73.             &nbsp;&nbsp;<asp:DropDownList id="ddlSubConName" runat="server" Width="88px"></asp:DropDownList>
    74.         </td>
    75.     </tr>
    76.     <tr>
    77.         <td vAlign=top align=left colspan="4">
    78.             <br />  
    79.             <asp:Image id="Image1" runat="server" Width="700px" ImageUrl="~/Images/LItemSep.png"></asp:Image>
    80.  
    81.         </td>
    82.     </tr>
    83.     <tr>
    84.         <td vAlign=top align=left colspan="4">
    85.         <br />  
    86.         <cc1:UpdatePanel id="updatePanel1" runat="server" >
    87.             <ContentTemplate>
    88.    
    89.             <asp:GridView id="grdListOfItem" runat="server" BorderColor="#CCCCCC" AutoGenerateColumns="False" Font-Size="Medium" >
    90.             <Columns>
    91.            
    92.             <asp:TemplateField>
    93.                 <HeaderTemplate>
    94.                     <asp:CheckBox ID="chkHeader" runat="server"  />
    95.                 </HeaderTemplate>
    96.                 <ItemTemplate>
    97.                     <asp:CheckBox ID="chkSelect" runat="server"  AutoPostBack = "true" OnCheckedChanged = "chkSelect_CheckedChanged"/>
    98.                 </ItemTemplate>
    99.             </asp:TemplateField>
    100.             <asp:TemplateField HeaderText="Tool ID">
    101.                 <ItemTemplate>
    102.                      <%# DataBinder.Eval(Container.DataItem,"ID") %>
    103.                 </ItemTemplate>
    104.             <ItemStyle Width="100px"></ItemStyle>
    105.             </asp:TemplateField>
    106.             <asp:TemplateField HeaderText="Tool Description">
    107.                 <ItemTemplate>
    108.                      <%#DataBinder.Eval(Container.DataItem, "ID_Description")%>
    109.                 </ItemTemplate>
    110.             <ItemStyle Width="250px"></ItemStyle>
    111.             </asp:TemplateField>
    112.             <asp:TemplateField HeaderText="Tons">
    113.                 <ItemTemplate>
    114.                      <%#DataBinder.Eval(Container.DataItem, "Tons")%>
    115.                 </ItemTemplate>
    116.             <ItemStyle Width="50px"></ItemStyle>
    117.             </asp:TemplateField>
    118.             <asp:TemplateField HeaderText="Status">
    119.                 <ItemTemplate>
    120.                      <%#DataBinder.Eval(Container.DataItem, "Status")%>
    121.                 </ItemTemplate>
    122.             <ItemStyle Width="120px"></ItemStyle>
    123.             </asp:TemplateField>
    124.             <asp:TemplateField HeaderText="Return Date">
    125.                 <ItemTemplate>
    126.                      <%#DataBinder.Eval(Container.DataItem, "Return_Date")%>
    127.                 </ItemTemplate>
    128.             <ItemStyle Width="120px"></ItemStyle>
    129.                 <EditItemTemplate>
    130.                     <Aj:CalendarExtender ID="CalendarExtender1" runat="server">
    131.                     </Aj:CalendarExtender>
    132.                     <asp:TextBox ID="dtIssue" runat="server" Width="120px"></asp:TextBox><asp:ImageButton
    133.                         ID="ImgCalenderF" runat="Server" AlternateText="Click to show calendar" ImageUrl="images/calendar_view_day.png"
    134.                         Width="16px" />
    135.                 </EditItemTemplate>
    136.             </asp:TemplateField>
    137.             </Columns>
    138.  
    139.         <AlternatingRowStyle BackColor="White"></AlternatingRowStyle>
    140.             <HeaderStyle BackColor="Lavender" BorderColor="Navy" BorderStyle="Solid" BorderWidth="1px" Font-Names="Tahoma" Font-Overline="False" Font-Size="Small" ForeColor="#0000C0" HorizontalAlign="Left"  />
    141.         </asp:GridView>
    142.    
    143.         </ContentTemplate>
    144.      </cc1:UpdatePanel>
    145.            
    146.  
    147.         </td>
    148.     </tr>
    149.     </table>
    150.     </div>
    151.     <br />
    152.     &nbsp;<br />
    153.     &nbsp; &nbsp; &nbsp;&nbsp;
    154. </asp:Content>

    Thanks for help. I glad to join this forum, I learn a lot from you guys.
    really appreciated.
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: ScriptManager is required on the page to use ASP.NET AJAX Script Components

    Try setting Mode="Conditional" for the UpdatePanel.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width