PC Review


Reply
Thread Tools Rating: Thread Rating: 2 votes, 1.00 average.

ControlParameter in FormView

 
 
David C
Guest
Posts: n/a
 
      22nd Aug 2008
I have a ControlParameter inside a FormView Template and an SqlDataSource
ControlParameter. I am referring to the control by name but I am getting
the following error.

Message: Could not find control 'ddlCountryRegionCode' in ControlParameter
'CountryCode'.

Stack Trace:
at System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext
context, Control control)
at System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context,
Control control)
at System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext
context, Control control)
at
System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object
sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Page.OnLoadComplete(EventArgs e)
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Below is the asp info from the page. Any help is greatly appreciated.
-David

<aspropDownList ID="ddlCountryRegionCode" runat="server"
DataSourceID="SqlCountryRegion"
DataTextField="Country" DataValueField="CountryRegionCode"
SelectedValue='<%# Bind("CountryRegionCode") %>'
AutoPostBack="True">
</aspropDownList>
<asp:SqlDataSource ID="SqlCountryRegion" runat="server"
ConnectionString="<%$ ConnectionStrings:RepSearchConnectionString %>"
SelectCommand="SELECT [CountryRegionCode], [Country] FROM
[CountryRegion] ORDER BY [Country]">
</asp:SqlDataSource>

<aspropDownList ID="ddlStateProvinceID" runat="server"
DataSourceID="SqlStateProvince"
DataTextField="StateProvince" DataValueField="StateProvinceID"
SelectedValue='<%# Bind("StateProvinceID") %>'
AppendDataBoundItems="true">
<asp:ListItem Value="0" Text=""></asp:ListItem>
</aspropDownList>
<asp:SqlDataSource ID="SqlStateProvince" runat="server"
ConnectionString="<%$ ConnectionStrings:RepSearchConnectionString %>"
SelectCommand="SELECT [StateProvinceID], [CountryRegionCode],
[StateProvince] FROM [StateProvince] WHERE ([CountryRegionCode] =
@CountryCode) ORDER BY [StateProvince]">
<SelectParameters>
<asp:ControlParameter ControlID="ddlCountryRegionCode"
DefaultValue="US" Name="CountryCode" PropertyName="SelectedValue"
Type="string" />
</SelectParameters>
</asp:SqlDataSource>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ControlParameter ControlID David C Microsoft ASP .NET 3 2nd Jan 2011 09:28 PM
using LIKE %% with controlparameter musosdev Microsoft ASP .NET 2 14th Aug 2008 02:10 PM
how to programmatically manipulate the ControlParameter property 'Name'? Bart Microsoft VB .NET 0 6th Jun 2007 06:09 PM
InsertItemTemplate and ControlParameter npei72@gmail.com Microsoft ASP .NET 2 6th Feb 2007 08:49 PM
how to add a controlparameter programmatically? Cas Microsoft VB .NET 1 21st Aug 2006 11:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:06 AM.