|
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.
|
|
|
|
|
Give me in detail that how can i migrate from vs2003 web project to vs2005.
Plz send me the steps that can work properly.
kissy
|
|
|
|
|
Please dont start your posts with
Kissy16 wrote: solution plz
There are plently of articles on the web relating to your post
http://www.google.co.uk/search?hl=en&q=migrate+from+vs2003+web+project+to+vs2005.&btnG=Google+Search&meta=
|
|
|
|
|
Hi Guys,
I have a linkbutton which calls a .net function which when clicked either displays or hides a DIV and changes an image. I also need this linkbutton to change the property of a javascript boolean variable.
The javascript in place currently produces a popup notifying users that they have not completed their registration if they try to navigate away from the page without having submitted the form. All I need the linkbutton to do is to submit the following "needToConfirm = false;". By doing so, when the user clicks the linkbutton and the DIV is displayed/hidden (this refreshes the page) the javascript knows not to display the popup box as the user is staying on the page. This works fine in Firefox but not IE.
I have added this to buttons, which work fine across both browsers, so it only the Linkbutton in IE that I am struggling.
Below is my code:
Client Side
<asp:linkbutton id="lbViewAllProfessions" runat="server" onclick="lbViewAllProfessions_OnClick" xmlns:asp="#unknown">
<asp:image id="imgIcon" runat="server" imageurl="images/general/icon-plus.gif" /> view all job types
</asp:linkbutton>
Server Side
Note: I have included the code for my working buttons below too.
//This is in my Page_Load
btnCandidateRegister.Attributes.Add("onClick", "needToConfirm = false;");
btnFindAddress.Attributes.Add("onClick", "needToConfirm = false;");
btnOKAddress.Attributes.Add("onClick", "needToConfirm = false;");
btnCancelAddress.Attributes.Add("onClick", "needToConfirm = false;");
lbViewAllProfessions.Attributes.Add("onClick", "needToConfirm = false;");
protected void lbViewAllProfessions_OnClick(object sender, EventArgs e)
{
if (imgIcon.ImageUrl == "images/general/icon-plus.gif")
{
divSkillsBox.Visible = true;
imgIcon.ImageUrl = "images/general/icon-minus.gif";
}
else
{
divSkillsBox.Visible = false;
imgIcon.ImageUrl = "images/general/icon-plus.gif";
}
}
Javascript
<script language="JavaScript" type="text/javascript">
var needToConfirm = true;
window.onbeforeunload = confirmExit;
function confirmExit()
{
if (needToConfirm)
{
needToConfirm = false;
return "Your have not completed your registration process.";
}else{
needToConfirm = true;
return;
}
}
</script>
I hope this is clear enough. Please let me know if you need anymore info.
Thanks in advance,
Martin
|
|
|
|
|
1. önclick--> change to onclick(check the difference in "ö" and "o". Both are not same.
2. btnFindAddress.Attributes.Add("onClick", "needToConfirm = false;");
--> btnCandidateRegister.Attributes.Add("onclick", "return NeedToConfirm()");
3. Write a Javascript function and put the logic ..... like needToConfirm = false;
4. Wherever you are adding to attribute collection then it should be "onclick" not "onClick"
check this ... I guess it will help you.
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi Arindam,
Thank you for looking into this.
I have done the following with my link button now:
lbViewAllProfessions.Attributes.Add("onClick", "return needToConfirmFalse();");
This is the javascript function that it calls:
function needToConfirmFalse()
{
needToConfirm = false;
return;
}
It still doesn't seem to work.
The strange thing about this is that is works fine in FF but not at all in IE. I am not sure what I am doing wrong but any help would be apprieciated.
Thanks again.
|
|
|
|
|
What you want to do in onclick event ??
Whats the use of needToConfirm into javascript function ??
use "return true" or "return false" instead of only "return" in javascript function.
Are you still gettng any error !!! ???
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi
I have a dll which will be used by multiple application. So I have build the dll(say "sample.dll"). Now using GACUTIL.exe I have installed into GAC. Now my epectation is to see the "sample.dll" into list of dll into .NET tab of Add reference window( As I assume that .NET tab of Add Reference window lists all GAC dlls.)
But while adding a reference I can not find sample.dll into that list.
Where I am going wrong? In any application where "sample.dll" will be used I want to take a refrence of "sample.dll" from GAC.
Thanks in advance!!!
Thanks,
Arindam D Tewary
|
|
|
|
|
Can you see the assembly when you browser to GAC ? Make sure your assembly has strong name generated.
|
|
|
|