|
i did'nt get.
plz tell me clearly..
|
|
|
|
|
Just copy the code part I have given !!
public PagerControl()
{
_pageNumber = 1;
}
after this line .
public partial class PagerControl : System.Web.UI.UserControl
{
private int _pageNumber;
So that it looks like:
public partial class PagerControl : System.Web.UI.UserControl
{
private int _pageNumber;
public PagerControl()
{
_pageNumber = 1;
}
Thanks,
Arindam D Tewary
|
|
|
|
|
ITS GIVING A ERROR ,
class,structs,interface method must have a return type.
|
|
|
|
|
it looks like the viewstate page number has not been created yet which is why its showing an object refrerence error as yoiu arent referencing anything!
|
|
|
|
|
kathyani wrote: if (this.PageNumber == 1)
{
You are retrieving the PageNumber before setting it.So
kathyani wrote: return int.Parse(ViewState["PageNumber"].ToString());
Will be null.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
|
Are you using the user control in all of your 11 pages?
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
yes , iam using all 11 pages
|
|
|
|
|
Why can't you set the pagenumber property at the design time itself(for the user control).I mean In the 11 pages.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
i took the previous ,next link buttons and 11 link buttons .
where i have to put pagenumber property ?
|
|
|
|
|
which one i have to put ?
pagenumber =11 (everypage)
or
page1.aspx ,pagenumber =1 ???
|
|
|
|
|
In each page corresponding page number!
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
Before i put the pageload .now i need to add .asp properties also??
pagercontrol.pagenumber=1
2ND PAGE
PAGERCONTROL1.PAGENUMBER=2
THANK U..
|
|
|
|
|
Add the following code to your user control Page Load, Before 'if'.
<br />
if(ViewState["PageNumber"]==null)<br />
ViewState["PageNumber"]="1";
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
its giving error sir.
i wrote code ..
public partial class PagerControl : System.Web.UI.UserControl
{
private int _pageNumber;
public int PageNumber
{
set
{
_pageNumber = value;
ViewState["pageNumber"] = value;
}
get
{
return int.Parse(ViewState["PageNumber"].ToString());
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (ViewState["pageNumber"] == null)
ViewState["pageNumber"] = "1";
if (this.PageNumber == 1)
{
lnkPrevious.Enabled = false;
}
else
{
lnkPrevious.Enabled = true;
}
if (this.PageNumber == 11)
{
lnkNext.Enabled = false;
}
else
{
lnkNext.Enabled = true;
}
}
|
|
|
|
|
What the same error?
PS is this the longest run for a post ever?
|
|
|
|
|
i put the code in forums ,once look it the code .
|
|
|
|
|
.netman wrote: is this the longest run for a post ever?
Not even close. You need to up it by an order of magnitude.
|
|
|
|
|
I think Its over
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
kathyani wrote: ViewState["pageNumber"] = value;
kathyani wrote: return int.Parse(ViewState["PageNumber"].ToString());
kathyani wrote: f (ViewState["pageNumber"] == null)
ViewState["pageNumber"] = "1";
PageNumber or pageNumber???
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
not working ...
iam waiting 4 u r reply
|
|
|
|
|
Now what error?
What changes you made?
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
page load i wrote like this
if (ViewState["pageNumber"] == null)
ViewState["pageNumber"] = "11";
if (this.PageNumber == 1)
{
lnkPrevious.Enabled = false;
}
|
|
|
|
|
kathyani wrote: if (ViewState["pageNumber"] == null)
ViewState["pageNumber"] = "11";
"pageNumber" The "P" Must be capital I think! Thats what I told.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
ITS WORKING....
THANKS A LOT LOTTTTTTTTTTTTTTTTTTTTT
|
|
|
|