• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1188
  • Last Modified:

Ajax Ignorance APlenty

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.  

Tony


  <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">    
        <HeaderTemplate>Schools</HeaderTemplate>
        <ContentTemplate>
        
        <div class="left all" style="width:98%; margin-top:10px; padding-left:1%; padding-right:5%;">  
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
          <ContentTemplate>
            <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>
                <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>
                      <div class="all" style="margin-top:3px;">
                        <asp:LinkButton ID="lnkEditGroup" runat="server">Edit Group</asp:LinkButton>
                      </div>
                      <div class="all" style="margin-top:3px;">
                        <asp:LinkButton ID="lnkDeleteGroup" runat="server">Delete Group</asp:LinkButton>
                      </div>
                    </div>
                    <div>
                      <asp:TreeView ID="treeSchoolGroups" Height="200px" runat="server">
                      </asp:TreeView>                                    
                    </div>
                  </div>
                  <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>
                  </div>      
                </div>
              </div>
              <div style="float:right; width:49%;">
                <div class="detailLabel">              
                  <asp:Label ID="lblSchoolReports" CssClass="label underline" runat="server">Reports:</asp:Label>
                </div>
                <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>
               </div>
             </div>  
             <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>
             </div>
             <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>                
              </div>                
             </div>                      
           </div>
           <cc1:ModalPopupExtender ID="ModalSales" OkControlID="btnSubmit" OnCancelScript="btnCancel" DropShadow="true" TargetControlID="treeSchoolGroups" PopupControlID="GroupSales1" runat="server">                      
           </cc1:ModalPopupExtender>    
           <uc1:GroupSales ID="GroupSales1" runat="server" />
           <uc1:GroupSchools ID="GroupSchools1" runat="server" />    
          </ContentTemplate>
        </asp:UpdatePanel>        
       </div>  
        </ContentTemplate>
   </cc1:TabPanel>  
  </cc1:TabContainer>
0
picsnet
Asked:
picsnet
1 Solution
 
Edwin_CCommented:
I'm afraid treeview cannot be used inside updatepanel.  See "Controls that Are Not Compatible with UpdatePanel Controls" in http://www.asp.net/ajax/documentation/live/overview/UpdatePanelOverview.aspx
0
 
picsnetAuthor Commented:
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

    Try

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

      objModal.Show()

    Catch ex As Exception

      Errors.HandleError(Page, ex)

    End Try

  End Sub
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now