Free Download:
|
| |
| Justuky | Asp.Net User |
| WebPartZone, GridView, ObjectDataSorce, DataList | 10/29/2007 3:04:48 AM |
0/0 | |
|
Hi all,
I'm trying to figure out how to solve this: Could not find control 'GridView3' in ControlParameter 'CourseID'.
Here is the code:
< asp:WebPartZone ID="WebPartZone3" runat="server" HeaderText=".">
<ZoneTemplate>
<asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" DataKeyNames="CourseID" DataSourceID="ObjectCoursesDataSource"
SelectedIndex="0" Title="Courses">
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="CourseID" HeaderText="CourseID" InsertVisible="False"
ReadOnly="True" SortExpression="CourseID" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Comments" HeaderText="Comments" SortExpression="Comments" />
</Columns>
</asp:GridView>
</ZoneTemplate>
</asp:WebPartZone>
< asp:DataList ID="DataList1" runat="server" DataKeyField="ID" DataSourceID="ObjectCourseLecturerDataSource">
<ItemTemplate>
Lecturer: </br>
<asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' Visible="false"></asp:Label><br />
FirstName:
<asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>'></asp:Label><br />
LastName:
<asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>'></asp:Label><br />
<br />
</ItemTemplate>
</asp:DataList><br />
< asp:ObjectDataSource ID="ObjectCourseLecturerDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetCourseLecturerData" TypeName="CourseLecturerDataSetTableAdapters.DetailsTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="GridView3" ConvertEmptyStringToNull="False" Name="CourseID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
Please help,
Thanks,
Justuky. |
| Nuwanda | Asp.Net User |
| Re: WebPartZone, GridView, ObjectDataSorce, DataList | 10/29/2007 11:49:49 PM |
0/0 | |
|
Hi, I'm no expert...but my two cents would be that because of the transformation of the gridview control to a generic web part control, you can't see it (from objectdatasource to zonetemplate). Grouping the gridview and objectdatasource to the same user control and adding that control to the zonetemplate might do the trick.
Please do correct me with a shorter/better solution if you have one |
| Nai-Dong Jin - | Asp.Net User |
| Re: WebPartZone, GridView, ObjectDataSorce, DataList | 10/30/2007 7:45:28 AM |
0/0 | |
|
Hi,
Nuwanda is right. Since the control has been wrapped as a generic web part, you can?t access them directly.
Besides, based on your code, I can?t find any controls named ?CourseID?. Do you mean the BoundField with a ?CourseID? DataField? If so, I?m afraid it can?t be a control which can be used in ControlParameter.
Thanks.
Sincerely, Michael Jin. Microsoft Online Community Support ?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ? |
| Justuky | Asp.Net User |
| Re: WebPartZone, GridView, ObjectDataSorce, DataList | 10/30/2007 12:12:54 PM |
0/0 | |
|
Hi Nai-Dong Jin,
The control is the GridView3 and its parameter is the CourseID! it's not the problem though.
To clear my self: There is no problem with the code without the "WebPartZone".
Thanks,
Justuky. |
|
| |
Free Download:
|
Web:WebPartZone, GridView, ObjectDataSorce, DataList - ASP.NET Forums Re: WebPartZone, GridView, ObjectDataSorce, DataList ... Re: WebPartZone, GridView, ObjectDataSorce, DataList ... ng.asp-net-forum.web_parts_and_personalization/11 - fix error ... Swapping of controls in web parts, 6, 12, 10/30/2007 1:15:21 PM. WebPartZone, GridView, ObjectDataSorce, DataList, 3, 9, 10/30/2007 12:12:54 PM ... Time to log somebody out - ng.asp-net-forum.security - Fix error ... webpartzone, gridview, objectdatasorce, datalist · dnn 2.0 whois registrars · club web site login works from vs 2k5 connecting to sql server 2k5, ... @IT:Insider.NET 会議室 ディレクトリ - Visual Studio.NET/開発 ... DataListへのページング機能追加方法, 10, 2008/09/09. GridView 半角文字の折り返し ...... NET】 WebPartZoneコントロールを横方向にレイアウトできますか? ... WebPartZone, GridView, ObjectDataSorce, DataList - ASP.NET Forums Re: WebPartZone, GridView, ObjectDataSorce, DataList ... Re: WebPartZone, GridView, ObjectDataSorce, DataList ... ng.asp-net-forum.web_parts_and_personalization/11 - fix error ... Swapping of controls in web parts, 6, 12, 10/30/2007 1:15:21 PM. WebPartZone, GridView, ObjectDataSorce, DataList, 3, 9, 10/30/2007 12:12:54 PM ... Time to log somebody out - ng.asp-net-forum.security - Fix error ... webpartzone, gridview, objectdatasorce, datalist · dnn 2.0 whois registrars · club web site login works from vs 2k5 connecting to sql server 2k5, ... @IT:Insider.NET 会議室 ディレクトリ - Visual Studio.NET/開発 ... DataListへのページング機能追加方法, 10, 2008/09/09. GridView 半角文字の折り返し ...... NET】 WebPartZoneコントロールを横方向にレイアウトできますか? ... WebPartZone, GridView, ObjectDataSorce, DataList - ASP.NET Forums Re: WebPartZone, GridView, ObjectDataSorce, DataList ... Re: WebPartZone, GridView, ObjectDataSorce, DataList ... ng.asp-net-forum.web_parts_and_personalization/11 - fix error ... Swapping of controls in web parts, 6, 12, 10/30/2007 1:15:21 PM. WebPartZone, GridView, ObjectDataSorce, DataList, 3, 9, 10/30/2007 12:12:54 PM ... |
|
Search This Site:
|
|