DetailsView FormView - SelectedValue bug
-
hi guys. i have strange bug or problem with this two controls. i will simplify my code as much as i can. i have this markup:
<asp:FormView ID="fv" runat="server" DataSourceID="sds" DataKeyNames="id">
</asp:FormView><asp:DetailsView ID="dv" runat="server" DataSourceID="sds" DataKeyNames="id">
</asp:DetailsView><asp:SqlDataSource ID="sds" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
ProviderName="System.Data.OleDb" SelectCommand="SELECT * FROM [tablica]" >
</asp:SqlDataSource>and lets say i need on first PageLoad get SelectedValue from eather of these:
protected void Page_Load(object sender, EventArgs e)
{
object fvValue = fv.SelectedValue;
object dvValue = dv.SelectedValue;
}so here is strange situation (looks like evil bug!). fvValue and dvValue have null value, but debuging code using Visual Studio with brakepoints; when i collapse fv or dv and navigate to SelectedValue property it changes from null to "something"? anyone encounter this situation?