The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Page.GetPostBackEventReference()

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eric Wise

Posts: 126
Nickname: ewise
Registered: Apr, 2005

Eric Wise is a senior .NET consultant.
Page.GetPostBackEventReference() Posted: Apr 27, 2005 9:22 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Eric Wise.
Original Post: Page.GetPostBackEventReference()
Feed Title: Eric Wise
Feed URL: /error.htm?aspxerrorpath=/blogs/eric.wise/rss.aspx
Feed Description: Business & .NET
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Eric Wise
Latest Posts From Eric Wise

Advertisement

Interesting find at work today.  One of my developers had two asp:image controls positioned to the right and left of a button.  The developer wanted on the click of an image to call the button postback.  I had no idea that the GetPostBackEventReference(control) even existed until Brendan pointed me to it (thanks buddy).

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Page.IsPostBack Then
            imgLeft.Attributes.Add("onclick", Page.GetPostBackEventReference(myButton))
            imgRight.Attributes.Add("onclick", Page.GetPostBackEventReference(myButton))
        End If
    End Sub

Is this "Coding Better"?  Hell if I know, it seems to work though.

Read: Page.GetPostBackEventReference()

Topic: Fabrikam 3.1 Previous Topic   Next Topic Topic: Refactoring pattern quiz number 1 answered

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use