Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Yovav Gad 41 posts 62 karma points
    Jul 29, 2010 @ 00:21
    Yovav Gad
    0

    LinkButton PostBackUrl causes all button events not to fire

    Dear Umbraco

    I lost about a whole day on this, so hopefully it can help others (or me again after I'll forget)

    For some reason Umbraco 4.5 have a problem with a LinkButton and it causes all the button events not to fire

    (I wonder if more asp: server controls are affected)

     

    TestControl.ascx :

    <%@ Control
        Language="VB"
        Inherits="TestControl"
        CodeFile="TestControl.ascx.vb"
    %>

    <fieldset>
        <br />
        <legend>TestControl</legend>

        <asp:TextBox runat="server" ID="_textBoxTest" />
        <asp:Button runat="server" ID="_buttonTest" OnClick="_buttonTest_Click" Text="Test" />
       
        <%-- This LinkButton will break all the event handlers in this and other user controls on the page --%>
        <asp:LinkButton runat="server" ID="_linkButtonTest" Text="Test" PostBackUrl="http://www.google.com" />
        <br />
    </fieldset>

    TestControl.ascx.vb :

    Partial Class TestControl
        Inherits System.Web.UI.UserControl

        Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)

            MyBase.OnInit(e)

            _textBoxTest.Text = "Initial OnInit Value"

        End Sub

        Protected Sub _buttonTest_Click(ByVal sender As Object, ByVal e As System.EventArgs)

            _textBoxTest.Text = DateTime.Now.ToString()

        End Sub

    End Class

     

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Jul 29, 2010 @ 10:18
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies