FormView PageIndexChanging DataKeys

  • Thread starter Thread starter Stuart Shay
  • Start date Start date
S

Stuart Shay

Hello All:

I am working with a FormView Control

<asp:FormView ID="FormView1" DataKeyNames="Id,Date" runat="server"/>

In the FormView1_PageIndexChanging(object sender, FormViewPageEventArgs e)

How do I get the DataKeys for the New Page Index Selected ?

Thanks
Stuart
 
Figured it out, to get the DataKey the results need to be evaluated in the
FormView1_PageIndexChanged event and NOT FormView1_PageIndexChanging, makes
sense.

void FormView1_PageIndexChanged(object sender, EventArgs e)
{
int selectedValue = (int)FormView1.SelectedValue;
Response.Write("Selected Value" + selectedValue.ToString() +
"<br/>");

}

Thanks
Stuart
 
Back
Top