.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

DataPager: raise event when page changing

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :ASP.Net

I have a ListView and a DataPager beneath.

When the page is changed I bind the ListView from the PreRender event handler:

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        Dim postControl As Control = GetPostBackControl(Me)
        If Not postControl Is Nothing Then
            If TypeOf (postControl.Parent) Is DataPagerFieldItem Then
            End If
        End If
    End Sub

Is there any way of intercepting an event raised when the page is changed without relying on page.PreRender?

View Complete Post

More Related Resource Links

Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Reporting services in 2008 r2 how to get a report in a print button click event in my c#.net page


how to  get a report in my c#.net page button lick event also steps to call a report from asp.net to reporting services


Thanks in advance

Get A Raise: Discover a Series of Fortunate Event Handlers in Visual Basic


You may use them every day, but how much do you really know about events? What's going on when you add an event handler to a class? In this article, Ken Getz demonstrates various ways to interact with events and event handlers, and shows how they can solve common problems. Along with the article, you can download two sample applications (one for Visual Basic .NET 2002 and 2003 and one for Visual Basic 2005) and follow along.

Ken Getz

MSDN Magazine June 2005

Knowing the event occured in user control in current page




      My web application has user control which uses third party controls called Devexpress controls. The user control is a menu  and is part of the Master page. It is placed there because this needs to be available in all the pages. My user controls raises a even on item clicked. Now, My question is that Is there any way to know that the event has occurred in page_load of the current page in which I am in?

Changing aspx page causes session data to be lost...


Strange but true. Any ideas what might be causing this?


Catch button click event in different .aspx page.


I have a button which starts processing.
I want that when ever a button is click from page1.aspx .. a count down timer should start and displayed on page2.aspx.
I am thinking of using iframe to join 2 pages.

Please let me know your suggestions.


How to get object from the gridview selectindex changing Event.


I have a grid view which is populating with a data source through databind. And the Datasource is list of objects.Now when the user selected a row I want to get the object of that row.

I'm trying to get the row like this.


r = gvTruckCarrier.Rows[e.NewSelectedIndex];


drv = r.DataItem as DataRowView




but the drv value is

How to avoid viewstate in page load event??

Hello Everyone, Here Is my scenario,I haveMaster Page -> ASPX page -> User ControlUser control page is contains all dynamic bind controls (e.g Repeater) depended on ASPX Page (Only one parameter say ItemNo) The problem is, if I bound user control on page load event with passing respective parameters then it's create to much view state (I checked source file and it's almost 1.5 MB) In other way if I put one textbox, and a command button and I pass required parameter on button click and load the control then page size is ok (I checked and it's  < 500KB) So is it any way I can reduce my page/state size??

page init event

In the book pro asp.net it mentions:"In addition, if the page is not being requested for the firsttime (in other words, if it's a postback), ASP.NET deserializes the view state information and appliesit to all the controls.At this stage, the Page.Init event fires. However, this event is rarely handled by the web page,because it's still too early to perform page initialization. That's because the control objects may notbe created yet and because the view state information isn't loaded.""ASP.NET deserializes the view state information and applies it to all the controls."and "That's because the control objects may not be created yet and because the view state information isn't loaded."seems contradictory as if the view state is not loaded how come it is applied to the control?

Raise OnPropertyChanged event when Text Box Text has changed

Hi there I have a Wrapped Text Box that is bound to a Public String Property. I have a related OK Button that should be Enabled when the text changes to indicate there are 'items' in the Text Box. The problem is that the set accessor of the property (and thus OnPropertyChanged) is not being called until focus is lost from the text box - and I would like the Ok Button to be enabled before then. What is the the best way to raise the set when the Text Box text has changed? (A List Box is not an option) Thanks very much Joe

raise click event from javascript

HiI want to raise click event on linkbutton, when press "Enter ?" on textbox.I wrote this code:LinkButton1.Attributes.Add("onclick", myscript);but, can not call LinkButton1.onclick() , my linkbutton:href='javascript:WebForm_DoPostBackWithOptions(new%20WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$Login1$lbtEnter",%20"",%20true,%20"LoginGroup",%20"",%20false,%20true))'when call ctl00$ContentPlaceHolder1$Login1$lbtEnter.onclick();Error: ctl00_ContentPlaceHolder1_Login1_lbtEnter is not define

Anonymous Access to "Event Export" on sharepoint calendar display page

I am using a SharePoint calendar with events added in the list. When an anonymous user tries to use "Export Event" on the display page ,the user is prompted for a login. Is there a way that an anonymous user can download the .ics file without logging in ? Is anonymous access even possible ?    

Accessing master page from content page? Raising Event?

Here is my situation:I have a user control that has a menu in it.  This user control sits on my master page.  It is my main navigation menu for my application.I am having an issue where, on one of my pages, users seem to be leaving the page before committing all changes to the database, which results in a loss of data.So what I want to accomplish is - if the user is leaving this page and the data has not been saved yet, I want to prompt the user and say something like "The information is not yet saved, are you sure you want to leave this page" in a modal popup.So my approach is this:In my menu user control, create an event handler called MenuClicked that is raised when the menu web control's (in the user control) MenuItemClicked is raised, I raise my custom MenuClicked event.Then on my master page, I can catch this event in NavMenu_MenuClicked.My problem is - I need to catch this event in my content page, not the master?Am I approaching this correctly?Thanks in advancesb

Changing Document Property on Checkin Event

Hi, I am creating an event , which has to change a custom property from second draft to PreFinalArtifact when a person chechins that file. I have userd the following code. public   override void ItemCheckingOut(SPItemEventProperties properties) {   base.ItemCheckingOut(properties);   if( properties.BeforeProperties.ChangedProperties.ContainsValue("Second Draft")) { properties.BeforeProperties.ChangedProperties.Remove( "Document Artifact Stages"); properties.BeforeProperties.ChangedProperties.Add( "Document Artifact Stages","PreFinal Artifact"); }   } It is not working and further When i attach all W3p process visual studio 2005 terminates.

Redirecting to another page from an eventhandler on ItemAdding event

Hi,   I want to redirect to another page from an eventhandler on ItemAdding event. So please help me achieve in achieving this.    Thanks in Advance

Multiple instance of User Control on Page - Button Click Event

Hi, I have this Web User Control, with 3 controls:<asp:TextBox ID="txtSearch" runat="server" /> <asp:RequiredFieldValidator ID="rfvSearch" runat="server" ControlToValidate="txtSearch" Display="None" /> <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" /> In code behind: protected override void Render(HtmlTextWriter writer) { rfvSearch.ValidationGroup = this.ID + "_validation"; txtSearch.ValidationGroup = this.ID + "_validation"; btnSearch.ValidationGroup = this.ID + "_validation"; base.Render(writer); } protected void btnSearch_Click(object sender, EventArgs e) { Response.Redirect("ResultadoSearch.aspx?argumento=" + txtSearch.Text); } When I try to add two UserControl and I Click in btnSearch of second UserControl, txtSearch.txt returns value of first User control.How I can get the value of second txtSearch?

how to raise event in vb asp.net 2.0 ?

how to raise event in vb asp.net 2.0  ?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend