Ajax Ignorance APlenty

Posted on 2007-07-31
Last Modified: 2008-01-09
Here is a little bit of html... I am having problems with something I am trying to do with Ajax.  I've used the ajax toolkit a little bit, but am pretty much a beginner with it.  The summary of what I'm trying to do is have a tree where you select a node, and it pops up the modal dialog and you work with it to upate the node.  

I think I may have it all goofed up though.  Everything is in the tab control of the toolkit.  Then I have an update panel inside the tab container to do ajax stuff in there with the buttons that move stuff back and forth.  

Then I have this code thats supposed to open that modal also inside the update panel.  I tried to put it outside, but it didn't recognize the name of the tree then.  

I'm getting a javascript error when it runs.  Line 73 char 9 Object Required.... As you all know this is a very useful error, and it could really be no where near line 73 in the source.  


  <cc1:TabContainer style="margin-top:10px; margin-bottom:10px;" ID="tabContainer" Width="100%" Height="375px" runat="server">
    <cc1:TabPanel ID="tabSchools" BorderColor="ActiveBorder" BorderStyle="Solid" BorderWidth="1px" runat="server">    
        <div class="left all" style="width:98%; margin-top:10px; padding-left:1%; padding-right:5%;">  
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <div class="detailRow">
              <div style="float:left; width:49%;">
                <div class="detailLabel">              
                  <asp:Label ID="lblSchoolGroups" CssClass="label underline" style="margin-bottom:2px;" runat="server">Groups:</asp:Label>
                <div class="detailContent" style="padding-top:4px; overflow:auto;">
                  <div style="float:left; width:85%;">
                    <div class="all" style="font-size:8pt; padding-left:5px;">
                      <div class="all">                        
                        <asp:LinkButton ID="lnkAddGroup" runat="server">Add Group</asp:LinkButton>                    
                      <div class="all" style="margin-top:3px;">
                        <asp:LinkButton ID="lnkEditGroup" runat="server">Edit Group</asp:LinkButton>
                      <div class="all" style="margin-top:3px;">
                        <asp:LinkButton ID="lnkDeleteGroup" runat="server">Delete Group</asp:LinkButton>
                      <asp:TreeView ID="treeSchoolGroups" Height="200px" runat="server">
                  <div style="float:right; width:15%;">                    
                    <div style="padding-top:70px;">        
                      <div class="all"><asp:Button ID="btnLeftAll" Text="<<" Width="75%" runat="server" /></div>            
                      <div class="all padTop5"><asp:Button ID="btnLeft" Text="<" Width="75%" runat="server" /></div>
                      <div class="all padTop5"><asp:Button ID="btnRight" Text=">" Width="75%" runat="server" /></div>
                      <div class="all padTop5"><asp:Button ID="btnRightAll" Text=">>" Width="75%" runat="server" /></div>
              <div style="float:right; width:49%;">
                <div class="detailLabel">              
                  <asp:Label ID="lblSchoolReports" CssClass="label underline" runat="server">Reports:</asp:Label>
                <div class="detailContent" style="padding-top:4px;">
                  <asp:ListBox ID="lstSchoolReports" SelectionMode="Multiple" DataTextField="Title" DataValueField="Id" CssClass="select" AutoPostBack="true" Height="255px" Width="100%" runat="server"></asp:ListBox>        
             <div class="detailRow padTop10" style="width:95%;">
              <div class="detailContent">
                <span class="titleLabel">Report Title:</span>
                <p style="text-indent:0px; display:inline;"><asp:Label ID="lblSchoolTitle" CssClass="label" runat="server"></asp:Label></p>                  
             <div class="detailRow padTop10" style="width:95%;">
              <div class="detailContent">
                <span class="descriptionLabel">Report Description:</span>
                <p style="text-indent:0px; display:inline;"><asp:Label ID="lblSchoolDescription" CssClass="label" runat="server"></asp:Label></p>                
           <cc1:ModalPopupExtender ID="ModalSales" OkControlID="btnSubmit" OnCancelScript="btnCancel" DropShadow="true" TargetControlID="treeSchoolGroups" PopupControlID="GroupSales1" runat="server">                      
           <uc1:GroupSales ID="GroupSales1" runat="server" />
           <uc1:GroupSchools ID="GroupSchools1" runat="server" />    
Question by:picsnet
    LVL 16

    Accepted Solution

    I'm afraid treeview cannot be used inside updatepanel.  See "Controls that Are Not Compatible with UpdatePanel Controls" in
    LVL 1

    Author Comment

    I found out to do what I needed to do that I needed to open it from the server.  I read somewhere that you could do that, but I can't get it to work.  It always says the targetcontrol is null in the exception.  Its not taking the targetcontrolid, and setting the target control for some reason.  

      Protected Sub lnkEditGroup_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkEditGroup.Click


          Dim objModal As New AjaxControlToolkit.ModalPopupExtender()
          objModal.DropShadow = True
          objModal.TargetControlID = Me.lnkEditGroup.ClientID
          objModal.PopupControlID = Me.pnlSales.ClientID


        Catch ex As Exception

          Errors.HandleError(Page, ex)

        End Try

      End Sub

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now