Copied to clipboard

Flag this post as spam?

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


  • Ulrik Olsen 1 post 21 karma points
    Jul 02, 2013 @ 07:37
    Ulrik Olsen
    0

    Button onclick not firing first time in protected pages

    Hi

    i'm sorry for a novice question, but i have lokked for a solution for quite some time now

    I have a small usercontrol, where I made a simple calulation for test purpose.

    If I put the user control on a page which are not under "Role based protection", everything works perfectly.

    But when the user control is under on a page which are under "Role based protection" this is whats happens:

    The first time i click the submit button, the onclick event wont fire. The page loads and its a postback.

    Second time I click the submit button It works perfectly. 

    The user control is in a template and the button is in <form runat="server"> <form> tag

    .ascx code:

    Amount
    <asp:TextBox ID="txtAmount" runat="server" />
    <asp:Button ID="btnSubmit" Text="Submit" runat="server" OnClick="btnSubmit_Click" />
    <br />
    <asp:Label ID="lblResult" runat="server" />

     

    Code behind:

           protected void btnSubmit_Click(object sender, EventArgs e)
            {
                double GST = 1.25;
                double Result;
                Result = double.Parse(txtAmount.Text) * GST;
                lblResult.Text = Result.ToString("0.00");
            }

    It's in Umbraco v6.0.5

    Any help or advice will be helpful because this is dragging too much now and I really need to complete.

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft