Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Master\detail View Records in different Ajax TAB panels

Posted on 2009-07-16
4
Medium Priority
?
673 Views
Last Modified: 2013-11-26
I have been working with the Ajax Tab panels and created a Gridview in 1 TAB panel and a detail view in a second TAB panel...Each TAB panel is in a different DIV container on the form.  The idea was to allow the Gridview to select a record and have the detail view show that record.  This is not working at all...When I put the Detail view in the same DIV as the gridview all works fine.

The error that is being displayed is:

Could not find control 'GRIDView1' in ControlParameter 'ID'.

I researched that error, but none of the fixes seem to work.

I have pasted the code for some of the page where the error happens...

Any advice or web page references would be appreciated!!

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Locks.aspx.vb" Inherits="Locks" %>
 
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
       <asp:ScriptManager ID="ScriptManager1" runat="server">
       </asp:ScriptManager> 
 
            <asp:AccessDataSource ID="AccessDataSource3" runat="server" 
            DataFile="App_Data\LockNKey.mdb" 
            SelectCommand="SELECT * FROM [Locks] WHERE ([ID] = ?)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="GridView1" Name="ID" 
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
        </asp:AccessDataSource>
 
            <asp:AccessDataSource runat="server" DataFile="App_Data\LockNKey.mdb" 
                DeleteCommand="DELETE FROM [Locks] WHERE [ID] = ? AND (([Lock] = ?) OR ([Lock] IS NULL AND ? IS NULL)) AND (([Key] = ?) OR ([Key] IS NULL AND ? IS NULL)) AND (([Door] = ?) OR ([Door] IS NULL AND ? IS NULL)) AND (([Building] = ?) OR ([Building] IS NULL AND ? IS NULL))" 
                InsertCommand="INSERT INTO [Locks] ([ID], [Lock], [Key], [Door], [Building]) VALUES (?, ?, ?, ?, ?)" 
                SelectCommand="SELECT * FROM [Locks]" 
                UpdateCommand="UPDATE [Locks] SET [Lock] = ?, [Key] = ?, [Door] = ?, [Building] = ? WHERE [ID] = ? AND (([Lock] = ?) OR ([Lock] IS NULL AND ? IS NULL)) AND (([Key] = ?) OR ([Key] IS NULL AND ? IS NULL)) AND (([Door] = ?) OR ([Door] IS NULL AND ? IS NULL)) AND (([Building] = ?) OR ([Building] IS NULL AND ? IS NULL))" 
                ID="AccessDataSource2" ConflictDetection="CompareAllValues" 
            OldValuesParameterFormatString="original_{0}">
                <DeleteParameters>
<asp:Parameter Name="original_ID" Type="Int32"></asp:Parameter>
                    <asp:Parameter Name="original_Lock" Type="String" />
                    <asp:Parameter Name="original_Key" Type="String" />
                    <asp:Parameter Name="original_Door" Type="String" />
                    <asp:Parameter Name="original_Building" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
<asp:Parameter Name="Lock" Type="String"></asp:Parameter>
<asp:Parameter Name="Key" Type="String"></asp:Parameter>
<asp:Parameter Name="Door" Type="String"></asp:Parameter>
<asp:Parameter Name="Building" Type="String"></asp:Parameter>
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Lock" Type="String"></asp:Parameter>
<asp:Parameter Name="Key" Type="String"></asp:Parameter>
<asp:Parameter Name="Door" Type="String"></asp:Parameter>
<asp:Parameter Name="Building" Type="String"></asp:Parameter>
<asp:Parameter Name="original_ID" Type="Int32"></asp:Parameter>
    <asp:Parameter Name="original_Lock" Type="String" />
    <asp:Parameter Name="original_Key" Type="String" />
    <asp:Parameter Name="original_Door" Type="String" />
    <asp:Parameter Name="original_Building" Type="String" />
</UpdateParameters>
</asp:AccessDataSource>
 
            <HeaderTemplate>
                Locks
            </HeaderTemplate>
            <ContentTemplate>
<TABLE style="WIDTH: 100%; height: 564px;"><TBODY>
<TR style="WIDTH: 460px; HEIGHT: 290px"><TD>
<DIV style="WIDTH: 100%; HEIGHT: 270px">
<cc1:TabContainer id="TabContainer2" runat="server" Height="270px" Width="100%" ActiveTabIndex="0" __designer:wfdid="w8">
<cc1:TabPanel runat="server" HeaderText="Building" Height="100%" Width="100%" ID="TabPanel21"><HeaderTemplate>
                            Locks
                        
</HeaderTemplate>
<ContentTemplate>
<DIV style="OVERFLOW: auto; WIDTH: 100%; HEIGHT: 100%">
    <asp:GridView id="GridView1" runat="server" Width="100%" __designer:wfdid="w9" ForeColor="#333333" DataSourceID="AccessDataSource2" GridLines="None" EmptyDataText="There are no data records to display." DataKeyNames="ID" CellPadding="4" AutoGenerateColumns="False">
<AlternatingRowStyle BackColor="White" ForeColor="#284775"></AlternatingRowStyle>
<Columns>
<asp:CommandField ShowSelectButton="True"></asp:CommandField>
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
        ReadOnly="True" SortExpression="ID"></asp:BoundField>
<asp:BoundField DataField="Lock" HeaderText="Lock" SortExpression="Lock"></asp:BoundField>
<asp:BoundField DataField="Key" HeaderText="Key" SortExpression="Key" />
<asp:BoundField DataField="Door" HeaderText="Door" SortExpression="Door" />
<asp:BoundField DataField="Building" HeaderText="Building" SortExpression="Building"></asp:BoundField>
</Columns>
 
<EditRowStyle BackColor="#999999"></EditRowStyle>
 
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"></FooterStyle>
 
<HeaderStyle HorizontalAlign="Left" BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"></HeaderStyle>
 
<PagerStyle HorizontalAlign="Center" BackColor="#284775" ForeColor="White"></PagerStyle>
 
<RowStyle BackColor="#F7F6F3" ForeColor="#333333"></RowStyle>
 
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333"></SelectedRowStyle>
</asp:GridView>
 
 
 </DIV>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer> </DIV></TD><TD vAlign=bottom style="width: 512px">
        <DIV style="WIDTH: 467px">&nbsp;<asp:Panel style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; PADDING-TOP: 8px" id="Panel1" runat="server" Height="269px" BorderStyle="Solid" BorderWidth="1px" BorderColor="#999999" __designer:wfdid="w10">
            <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                CellPadding="4" DataKeyNames="ID" DataSourceID="AccessDataSource3" 
                ForeColor="#333333" GridLines="None" Height="260px" Width="319px">
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <Fields>
                    <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                        ReadOnly="True" SortExpression="ID" />
                    <asp:BoundField DataField="Lock" HeaderText="Lock" SortExpression="Lock" />
                    <asp:BoundField DataField="Key" HeaderText="Key" SortExpression="Key" />
                    <asp:BoundField DataField="Door" HeaderText="Door" SortExpression="Door" />
                    <asp:BoundField DataField="Building" HeaderText="Building" 
                        SortExpression="Building" />
                </Fields>
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#999999" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:DetailsView>

Open in new window

0
Comment
Question by:dgore1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24870565
The error is because asp.net includes the parent container name with the control's id when rendering. You could also try with Views.
0
 

Author Comment

by:dgore1
ID: 24871573
I'm still pretty new at this process so you'll have to bear with me.....I found the control ID but can't figure out how to make them talk to each other....

Also, not sure how to make it work with Views or for that matter what Views does.

sorry for these type questions!!
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 24876553
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

610 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