CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.faq_frequently_asked_questions Tags:
Item Type: NewsGroup Date Entered: 9/9/2007 8:28:42 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 48 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
abrar
Asp.Net User
how to navigate an event located in amaster page9/9/2007 8:28:42 AM

0

i use a link button in a master page and i want to use on click event of that link button in another page ... how can i?

martinhn
Asp.Net User
Re: how to navigate an event located in amaster page9/9/2007 10:13:06 AM

0

You can do it this way:

In the page where you want to handle the click event of the linkbutton, add this code to the Page_Load:

 

    protected void Page_Load(object sender, EventArgs e)
    {
      LinkButton lb = (LinkButton)this.Master.FindControl("linkbuttonname");
      lb.Click += new EventHandler(lb_Click);
    }
Now we've hooked up the event, and we have to handle the event like this:
 
    void lb_Click(object sender, EventArgs e)
    {
      throw new Exception("The method or operation is not implemented.");
    }
 

That should do it...


--
MartinHN

dnknormark.net - with C#, AJAX and ASP.NET

↑ Grab this Headline Animator

abrar
Asp.Net User
Re: how to navigate an event located in amaster page9/9/2007 10:21:45 AM

0

may you write this code in vb.net

martinhn
Asp.Net User
Re: how to navigate an event located in amaster page9/9/2007 12:51:03 PM

0

    Protected  Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
      Dim lb As LinkButton = CType(Me.Master.FindControl("linkbuttonname"), LinkButton)
      lb.Click += New EventHandler(lb_Click)
    End Sub
 
    Private  Sub lb_Click(ByVal sender As Object, ByVal e As EventArgs)
      Throw New Exception("The method or operation is not implemented.")
    End Sub

'----------------------------------------------------------------
' Converted from C# to VB .NET using CSharpToVBConverter(1.2).
' Developed by: Kamal Patel (http://www.KamalPatel.net)
'----------------------------------------------------------------


--
MartinHN

dnknormark.net - with C#, AJAX and ASP.NET

↑ Grab this Headline Animator

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:




   
  Privacy | Contact Us
All Times Are GMT