|
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.
|
|
|
|
|
once again thanks alot sir ...
bye sir
|
|
|
|
|
You are always welcome
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
sir code not working properly..
plz look into the entire code ,plz let me helppp
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");
}
}
}
|
|
|
|
|
Who gave me 5 for this?
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
i gave u 5 .u give good help 4 me..
|
|
|
|
|
But that was not an answer!!
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
|
um set the page number before using it...
|
|
|
|
|
i already set page number like this ,where i have to change.
public partial class PagerControl : System.Web.UI.UserControl
{
private int _pageNumber = 11;
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 (this.PageNumber == 1)
{
lnkPrevious.Enabled = false;
}
else
{
lnkPrevious.Enabled = true;
}
if (this.PageNumber == 11)
{
lnkNext.Enabled = false;
}
else
{
lnkNext.Enabled = true;
}
}
|
|
|
|
|
Wow - so you ALWAYS have 11 pages of data, no matter what ? For the lifetime of your app ?
Please, PLEASE, tell me no-one is paying for this code.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
i got the solution..
thank u...
|
|
|
|
|
Did you fix your code so that it doesn't assume 11 pages of records ? The point is that your code leaves a lot to be desired, it's definately not good enough for people to be paying for. That's cool, if you're still learning ( we all do that ), but if you're taking on work and bringing these sort of questions here, something is very wrong.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
This plain will not work. The redirect will reset your paging. Even if it did work, it would work only if the page was 1, THEN when the user clicks back, it will disable. But then you STILL redirect, which loses your state.
But a book on ASP.NET and read it, you plainly have a lot to learn.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
hi
You can add the attributes for that link button inside
that if condition
example;
if(condition)
{
lnkHistory.Attributes.Add("OnClick","JscriptMethod");
}
Regards
Joe
|
|
|
|
|
Thank u joe..
but which javascript method i have to write?
i have no idea in javascript .plz guide me.
|
|
|
|
|
Well, this won't work b/c you want to set it before someone does anything on the client. This guy is as confused as you are.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
I have a html select contorl and loaded it with the data i had derived from the database into the array list in the following fashion.
Select A Type
]]>
]]>
]]>
The list box is loaded fine but when i click on the option item of the select control then i got the following error message An action named 'Convertible' could not be found on the controller.
if i used
]]>
instead of html.actionlink then it works fine but i get the whole path in the option text.
please help me.
Thank you
|
|
|
|
|
Seems a classic ASP page problem !! Isnt it?? How ASP.NET is related to it buddy ??
Thanks,
Arindam D Tewary
|
|
|
|
|
actually i am working with asp.net mvc framework i returned the value in the viewdata and want to load the viewdata["Type"] value into the select control. the control is loaded fine but have problem while clicking on the option.
|
|
|
|