Don't pass the primary key in URL, instead, have your SelectCommand statement
for your SQL datasource that is bound to the formview read something like
"Select PrimaryKey, field1, field2, fields3 from table where
primarykey=@PrimaryKey"
then have a <SelectParameters> section that reads something like this
<SelectParameters>
<asp:ControlParameter ControlID="FormViewID" Name="PrimaryKey"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
Then it will just work.
"Dabbler" wrote:
What is the best way to have a FormView page open on a specific row selected
from a GridView?
I'm passing the primary key in the url as in
detailview.aspx?mode=edit&pk=42
I'm using an SqlDataSource to bind the FormView to the data.
Thanks for any samples or links.