hello everyone.
i have a website of ads. how to go to next page, when a page is filled?
each page has:
what should i add, to go to the next page, having the same panel?
appreciate with codes. kind regards...
hello everyone.
i have a website of ads. how to go to next page, when a page is filled?
each page has:
what should i add, to go to the next page, having the same panel?
appreciate with codes. kind regards...
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
venus najadPosted Aug 13, 2024, 2:13 PM
hello mr nigam again,
i have solvede my issue by putting pagesize enough high in gridview. and increased the number of rows in panel enough.
because i have seen in other websites that i apperas ads by scrolling down. have i right? thanks if you answer, kind regards
venus najadPosted Aug 13, 2024, 11:21 AM
i have yet my problem...i fill my page with ads, dynamically. i use table and put it in a panel. in a loop the page is filled, i try to fill 60 ads in one page. but the rest of vads must be filled in the next page automatically, but how?
i have used:
i get this error: error creating control- pnlrepeat, type ystem.web.ui.webcontrol.repeater does not have a public property named panel!
i suppose that i should create another panel, called pnlrepeat and add panelAd to it, should i??!
in code behind, i have fillpage function, there i create control dynamiclly and fill them from my gridview. it works perfect, but my gridview can have 200 rows, and i have defined that a page contains 60 rows. the filling continues, but how i should do to see them in another page (through button or linkbutton as previous page/ next page). in repeater or pnlrepeat i should define and panelAd... appreciate any help, please with codes... you can correct my code above and also tell how i should to do in code behind, also with codes... very kind regards
venus najadPosted Aug 13, 2024, 6:39 AM
dear mr nigam, thanks for your respond, i need your help to give your steps in form of codes, please and thanks, specially step 2 and 3...
i fill the page dynamically and put each ad in a panel. the panel must be repeated. i used but it doesnt work, because i must define the contecx of the panel.
i appreciate if you give each steps in form of codes to me... kind regards
Adarsh NigamPosted Aug 13, 2024, 4:39 AM
Here’s a more concise and conversational version:
To paginate your ads in ASP.NET, you can use a `PagedDataSource` to handle the data split into pages. You'll need navigation buttons to move between these pages.
1. **Set Up Your Panel and Buttons:**
- Use an `asp:Panel` to display ads.
- Add buttons for "Previous" and "Next" to navigate pages.
2. **Code Behind:**
- Store the current page index in `ViewState`.
- Use `PagedDataSource` to manage pagination. Set `PageSize` to 60 (for 3 columns and 20 rows).
- Bind ads to the panel dynamically using server controls.
- Enable/Disable navigation buttons based on the current page.
3. **Example Code:**
- Define your panel and navigation buttons in the ASPX page.
- Use the `CurrentPage` property in the code-behind to manage page index.
- Bind the ads to the panel and update the navigation controls.
This setup lets users move between ad pages smoothly, keeping your interface clean and functional.