Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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
is working on a reply...