FormView PageIndexChanging DataKeys

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
 
S

Stuart Shay

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top