The following code shows a part of my webpage.
<h3 ID = "pageno">Page <%=PageNumber%> of <%=MaxPageNumber()%></h3> <asp:Button ID="btnPrevPage" runat="server" Text="Prev Page" Class="Shape1" OnClick="onPrevPageClick" /> <asp:Button ID="btnNextPage" runat="server" Text="Next Page" Class="Shape1" OnClick="onNextPageClick" /> In the code behind, I am using the following code.
btnPrevPage.Visible = false; btnNextPage.Visible = false; pageno.Visible = false; The problem is the buttons are getting hidden whereas when the third line to hide the page no, when I include that in the code, it throws the following error CS0103: The name 'pageno' does not exist in the current context. How do I fix this?
The full stack trace is as follows
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0103: The name 'pageno' does not exist in the current context Source Error: Line 37: BlogEntries1.SetData(myDataSet, ""); Line 38: Line 39: pageno.Visible = false; Line 40: btnPrevPage.Visible = false; Line 41: btnNextPage.Visible = false; Source File: c:\Inetpub\wwwroot\casts-alt\blog\blog2.aspx.cs Line: 39