Login
Register
Tutorials
Forum
Career Development
Resources
Reviews
Jobs
Interview
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
New Members FAQ
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Social
|
Talk to Webmaster Tony John
Online Members
Pawan Awasthi
More...
Forums
»
.NET
»
ASP.NET
»
Specified argument was out of range
Posted Date:
29 Jun 2012
Posted By::
S.N.V.Rama Krishna
Member Level:
Silver
Member Rank:
1499
Points
: 5
Responses:
1
i am using list view. In data pager i have written _PreRender event. under it i have written code as
protected void Pagerindex_PreRender(object sender, EventArgs e)
{
int CurrentPage = 0;
Int32.TryParse(Request.QueryString["page"], out CurrentPage);
CurrentPage = CurrentPage.Equals(0) ? 1 : CurrentPage;
Button PreviousLink = Pagerindex.Controls[0].Controls[0] as Button;
Button NextLink = Pagerindex.Controls[0].Controls[2] as Button;
if (PreviousLink != null)
{
if (CurrentPage.Equals(1))
{
PreviousLink.Visible = false;
}
else if (CurrentPage > 1)
{
PreviousLink.Visible = true;
}
}
if (NextLink != null)
{
if ((CurrentPage * Pagerindex.PageSize) >= Pagerindex.TotalRowCount)
{
NextLink.Visible = false;
}
else
{
NextLink.Visible = true;
}
}
}
i am gettin error at
Button PreviousLink=Pagerindex.Controls[0].Controls[0] as Button;
Tweet
Responses
#678158 Author:
Mohan M Devarinti
Member Level:
Gold
Member Rank:
488
Date: 29/Jun/2012 Rating:
Points
: 2
Hi SNV,
we can't get the control ids which are generated by the datapager I think so....
So, if do you wanna set the current pageindex, you can do like:
DataPagerProducts.SetPageProperties(CurrentPage * DataPagerProducts.PageSize, DataPagerProducts.PageSize, true);
Regards,
MURALI.
Post Reply
This thread is locked for new responses. Please post your comments and questions as a
separate thread
.
If required, refer to the URL of this page in your
new post
.
Tweet
Next :
Cannot able to access AsyncFileUpload??/showing error below??
Previous :
How catch results of stored procedure in asp.net page
Return to Discussion Forum
Post New Message
Category:
Related Messages
Validation Controls
no of click on advertisement in asp.net application
Please Please help.................. tooo urgent
Please tell me .Net interview Questions for 2+ Years Exp
To upload Documents like(doc,pdf,etc) to file system
Follow us on Twitter:
https://twitter.com/dotnetspider
Active Members
Today
Pawan Awasthi
(22)
srirama
(7)
baskar
(7)
Last 7 Days
baskar
(298)
Asheej T K
(173)
Ultimaterengan
(167)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds