FindControl Problem Production Server
I've got a Web User Control that contains a DetailsView. When that DetailsView is databound in my Development Environment everything works fine, but when the page is moved to the production server, the findcontrol isn't finding anything. Got any ideas?
Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles DetailsView1.DataBound
If Me.DetailsView1.CurrentMode = DetailsViewMode.Edit Then
Dim temp As BLL.Events = Me.DetailsView1.DataItem
Dim tempddl As DropDownList
tempddl = DetailsView1.FindControl("ddlcolor")
tempddl.SelectedValue = temp.Backcolor
End If
End Sub
<asp:TemplateField HeaderText="Backcolor" SortExpression="Backcolor">
<EditItemTemplate>
<asp:DropDownList ID="ddlColor" runat="server" DataSourceID="odsColors" DataTextField="value"
DataValueField="value">
</asp:DropDownList>
<asp:ObjectDataSource ID="odsColors" runat="server" SelectMethod="GetColors"
TypeName="dsci.landwarrior.UI.Helpers">
<SelectParameters>
<asp:Parameter DefaultValue="False" Name="insertEmpty" Type="Boolean" />
</SelectParameters>
</asp:ObjectDataSource>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Backcolor") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
The web control is on a page that uses a Master Page if that has any thing to do with it.
|