G
Guest
I have a teamplate field that uses a drop down list in a details view . The
drop down lit use its own data surce (DataSource 2)
But I am trying to make the default value from DataSource1 (same as Details
View)
Everything works great on my local machine but when I upload to remote server
This works
<EditItemTemplate>
<aspropDownList ID="MyField" runat="server"
DataSourceID="SqlDataSource2"
DataValueField="MyField" >
</aspropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:conCode %>"
SelectCommand="SELECT [MyField] FROM [MyTable] ORDER BY
[MyField]"></asp:SqlDataSource>
But when I bind to Value from Datasource1, it does not work on remote
machine only. All I did is add this here( SelectedValue='<%# Bind("MyField")
%>')
<EditItemTemplate>
<aspropDownList ID="MyField" runat="server"
DataSourceID="SqlDataSource2" SelectedValue='<%# Bind("MyField") %>'
DataValueField="MyField" >
</aspropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:conCode %>"
SelectCommand="SELECT [MyField] FROM [MyTable] ORDER BY
[MyField]"></asp:SqlDataSource>
Thanks
Paul
drop down lit use its own data surce (DataSource 2)
But I am trying to make the default value from DataSource1 (same as Details
View)
Everything works great on my local machine but when I upload to remote server
This works
<EditItemTemplate>
<aspropDownList ID="MyField" runat="server"
DataSourceID="SqlDataSource2"
DataValueField="MyField" >
</aspropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:conCode %>"
SelectCommand="SELECT [MyField] FROM [MyTable] ORDER BY
[MyField]"></asp:SqlDataSource>
But when I bind to Value from Datasource1, it does not work on remote
machine only. All I did is add this here( SelectedValue='<%# Bind("MyField")
%>')
<EditItemTemplate>
<aspropDownList ID="MyField" runat="server"
DataSourceID="SqlDataSource2" SelectedValue='<%# Bind("MyField") %>'
DataValueField="MyField" >
</aspropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:conCode %>"
SelectCommand="SELECT [MyField] FROM [MyTable] ORDER BY
[MyField]"></asp:SqlDataSource>
Thanks
Paul