Click here to Skip to main content
15,908,842 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good Day All, I have this little issue

C#
// On Page Load
<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" 
        Width="100%" AutoGenerateRows="False" DataKeyNames="StaffID" ForeColor="#333333" GridLines="None" CellPadding="4" 
        DataSourceID="SqlDataSource1">
       
                    <Fields>
                   
                        <asp:BoundField DataField="StaffOrder" HeaderText="Staff Order" 
                                SortExpression="StaffOrder" InsertVisible="False" ReadOnly="True" />
                          
                        <asp:BoundField DataField="Title" HeaderText="Question" SortExpression="Title" />
                                  
                            <asp:BoundField DataField="FullName" HeaderText="FullName" 
                                SortExpression="Name" />
                          
                            
                          
                        </Fields>
       
    </asp:DetailsView>  
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:MySqlLocalSqlServer %>" 
        
        SelectCommand="SELECT * FROM [Staff]  ORDER BY [StaffOrder]">
       
   
    </asp:SqlDataSource>

  protected void NextButton_Click(object sender, EventArgs e)
{
  System.Data.DataRowView dr = (System.Data.DataRowView)DetailsView1.DataItem;
if(DetailsView1.PageIndex == DetailsView1.PageCount - 1)
                {
                    NextButton.Text = "Finished";
                }
                else
                {
                    DetailsView1.PageIndex++;

//Once the next button is clicked, i want to display the StaffOrder and Staff Name in a Label... How Do i achieve this please.. Thanks For your time
                }
Posted
Comments
Sri Nivas.M 6-Jan-15 9:16am    
I guess you want to update the data when user clicks the next button. am i right?
Suvendu Shekhar Giri 6-Jan-15 14:03pm    
So what is the issue ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900