|
Hi!
I'm working with datapager with listview control to regulate the data being displayed in the listview. I want to get value of the current page number of the datapager as the user navigate the datapager. So let's say if the user clicks on next,prev,first,last as well as the numeric field button in the datapager it will return the current page index. So if the page is on page 3, I should get the value of 3? How do I do this in Asp.Net C#? Is there anybody could give me a sample code or any article about this functionality...Thanks!
|
|
|
|
|
The DataPager control[^] doesn't expose the current page index, but it does expose the PageSize[^] and StartRowIndex[^].
The current page index will be StartRowIndex / PageSize ; you just need to add 1 to get the page number.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I tried something like this:
protected void ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
{
int pageindex = (e.StartRowIndex / e.PageSize) + 1;
Label1.Text = pageindex.ToString();
}
but it won't still display the value in the label. Is there still something I miss? What appropriate event should I do this? I just want to get the correct value everytime the user clicks on the datapager to change the page. Thanks
|
|
|
|
|
The PagePropertiesChanging event looks like the right event to use. However, the PagePropertiesChangingEventArgs class[^] doesn't have a PageSize property; you need to use the MaximumRows property[^] instead.
protected void ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
{
int pageindex = (e.StartRowIndex / e.MaximumRows) + 1;
Label1.Text = pageindex.ToString();
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I tried to use this code also below as what you wrote
protected void ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
{
int pageindex = (e.StartRowIndex / e.MaximumRows) + 1;
Label1.Text = pageindex.ToString();
}
but it is not returning any value but just null everytime I click on any button of the datapager.
What could have been missing on this? Thanks
|
|
|
|
|
Is the event actually firing? Have you got AutoEventWireup="True" set on the page, or did you add the handler in the markup?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I don't think the event is firing and the page is already set as AutoEventWireup="True".
No I didn't add any handler on the mark up. Do I need to add anything from this?
|
|
|
|
|
Does your ListView still have ID="ListView1" ? If it does, then AutoEventWireup should take care of it.
Try adding OnPagePropertiesChanging="ListView1_PagePropertiesChanging" to the markup of the ListView to see if that makes any difference.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming...Thank you very much sir!I got it.
I thought after I added the Page_PropertiesChanging event would automatically
generate in the markup but when I checked there's none so I add it to the markup
and works now. Thank u for your help. How do I mark this thread as Resolved?
Cheers!
|
|
|
|
|
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="AutoComplete.asmx" />
</Services>
</asp:ScriptManager>
|
|
|
|
|
Rockstar_ wrote: <asp:ScriptManager ID="ScriptManager1" runat="server">
A Script Manager enables you to have & control AJAX controls on your web page. An AJAX control is not going to work if the Script Manager on the page is missing.
Rockstar_ wrote: <Services>
<asp:ServiceReference Path="AutoComplete.asmx" />
</Services>
This one references the Script Manager's ServiceRefrenceCollection, which contains several ServiceRefrence[^]s. A Service Reference registers a web service for use on your web page.
|
|
|
|
|
hi
i want to take cancel reason from user when he click on cancel linkbutton on the gridview
i wrote this line in the rowdatabound event
delLnk.OnClientClick = "return confirm('Are you sure you want to cancel this booking?');";
i need to take cancel reason from input dialog and insert it in the database
thanks in advance.
|
|
|
|
|
delLnk.OnClientClick = "return confirm('Are you sure you want to cancel this booking?');";
if(
confirm('Are you sure you want to cancel this booking?') )
{
// if true
}
else
{
//if false;
// you can prompt the user to enter the reason here. with the javacript's prompt() dialog box.
}
|
|
|
|
|
I have developed one application using C# .NET 2010. I had dynamically pass text value for QRCODE to the “Godex EZ-1100 Plus” printer.
e.g
Name: ABC
Std: Xth
Email ID: abc@gmail.com
I get print out of qrcode verywell but while reading qrcode it escapes next line and show the output in single line like this - Name: ABC Std: Xth Email ID: abc@gmail.com
I have qrcode related ebook but I found it very difficult to understand.
Can anybody help me to resolve the issue?
Winners don't do different thing they do thigs differentely.
|
|
|
|
|
Hi Everyone,
I'm trying to create a web.config file for security on an intranet.
I want it to have the following rules:
If someone browses to the site on a specific IP range, they get straight in.
If someone doesn't fall into that IP range, they are presented with a log in box that authenticates against an LDAP query.
I have gone down the route so far of the following method for IP access and it works fine.
<security>
<ipSecurity allowUnlisted="false">
<add ipAddress="x.x.x.0" subnetMask="255.255.255.0" allowed="true"/>
</ipSecurity>
</security>
<modules runAllManagedModulesForAllRequests="true"/>
How could I then combine this with LDAP authentication (if that's even possible)? Or should I take a different approach? My only concern so far is that the ipsecurity method is too specific and you are either allowed in or you're not with no room for another form of authentication.
Any tips would be much appreciated!
Thanks in advance,
Tom
|
|
|
|
|
Hi All,
please help me for my project,here i'm handling one free lancer project in dot net technology with C#.net
and my project is rental house management system i.e,
i have one building with 20 flats
and
*i want all 20 users with there privacy logins
*i want to see there status about there rental pay in the webpage
*push up mails for there status about the rental paying to the particular flat
*Rent pay by credit card transactions with there debit or credit card
*what are fields for the maintenance and there extra charges for plumbing,electrical services
*SMS Application for the remindering about the rent by month
*rent status check by month by month with there user logins
*Admin Rights
please please this is my first free lancer project i'm handling
please help me to complete my project and Thank you very much in advance
|
|
|
|
|
DO NOT post your message twice. If you want to edit your message, use the "Edit" link to change the original message.
You seemed to have missed the most important part of your message - an actual question! What you've posted is a list of requirements. If you're expecting someone else to do your work for you, you're in the wrong place.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Sir ji thaat's why i'm note that
this is the first project to me
so please read full question and answer
but dont discourage others ok
it shows ur overconfidence
|
|
|
|
|
I'm still waiting to see a question.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
|
|
Click the big blue "Browse Code" button, then click the "Download Snapshot" link.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
this is the waste of time with u
bye
|
|
|
|
|
For someone who wants complete code for a commercial contract, you are incredibly rude!
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|