|
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
|
|
|
|
|
Y did you rate 1 for me?
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
iam really sorry ,unintensionally i click rating ,after that i saw.
iamm very very sorry...
|
|
|
|
|
sir code not working properly..
plz look into the entire code ,plz let me helppp
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
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;
}
}
protected void lnkPrevious_Click(object sender, EventArgs e)
{
if (this.PageNumber ==1)
{
Response.Redirect("pge1.aspx");
lnkPrevious.Enabled = false;
lnkNext.Enabled = true;
}
else
{
this.PageNumber -= 1;
Response.Redirect( "pge"+this.PageNumber.ToString()+".aspx");
}
}
protected void lnk1_Click(object sender, EventArgs e)
{
Response.Redirect("pge1.aspx");
// lnkPrevious.Enabled = false;
//lnkNext.Enabled = true;
this.PageNumber = 1;
// Response.Redirect(this.PageNumber.ToString() + "pge.aspx");
}
protected void lnk2_Click(object sender, EventArgs e)
{
lnkPrevious.Enabled = true;
lnkNext.Enabled = true;
this.PageNumber = 2;
// Response.Redirect("Page" + this.PageNumber.ToString() + "pge2.aspx");
Response.Redirect( "pge2.aspx");
}
protected void lnk3_Click(object sender, EventArgs e)
{
lnkPrevious.Enabled = true;
lnkNext.Enabled = true;
this.PageNumber = 3;
Response.Redirect( "pge3.aspx");
}
protected void lnk4_Click(object sender, EventArgs e)
{
lnkPrevious.Enabled = true;
lnkNext.Enabled = true;
this.PageNumber = 4;
Response.Redirect( "pge4.aspx");
}
protected void lnk5_Click(object sender, EventArgs e)
{
lnkPrevious.Enabled = true;
lnkNext.Enabled = true;
this.PageNumber = 5;
Response.Redirect( "pge5.aspx");
}
protected void lnk6_Click(object sender, EventArgs e)
{
lnkPrevious.Enabled = true;
lnkNext.Enabled = true;
this.PageNumber = 6;
Response.Redirect( "pge6.aspx");
}
protected void lnk7_Click(object sender, EventArgs e)
{
lnkPrevious.Enabled = true;
lnkNext.Enabled = true;
this.PageNumber = 7;
Response.Redirect( "pge7.aspx");
}
protected void lnk8_Click(object sender, EventArgs e)
{
lnkPrevious.Enabled = true;
lnkNext.Enabled = true;
this.PageNumber = 8;
Response.Redirect( "pge8.aspx");
}
protected void lnk9_Click(object sender, EventArgs e)
{
lnkPrevious.Enabled = true;
lnkNext.Enabled = true;
this.PageNumber = 9;
Response.Redirect( "pge9.aspx");
}
protected void lnk10_Click(object sender, EventArgs e)
{
lnkPrevious.Enabled = true;
lnkNext.Enabled = true;
this.PageNumber = 10;
Response.Redirect( "pge10.aspx");
}
protected void lnk11_Click(object sender, EventArgs e)
{
lnkPrevious.Enabled = true;
lnkNext.Enabled = false;
this.PageNumber = 11;
Response.Redirect( "pge11.aspx");
}
protected void lnkNext_Click(object sender, EventArgs e)
{
if (this.PageNumber == 11)
{
//lnkNext.Enabled = false;
Response.Redirect("pge11.aspx");
}
else
{
this.PageNumber += 1;
Response.Redirect( "pge"+this.PageNumber.ToString()+".aspx");
}
}
}
|
|
|
|
|
kathyani wrote: ViewState["pageNumber"] = value;
Again why the "p" is in small?
kathyani wrote: code not working properly..
What error or what problem ?
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
sir now working..
very very veryyyyyyyyyy Thanks sir.
can u give u r mail id..
|
|
|
|
|
I'll be here in CP.
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
|
Code Project
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|