Possible bug: html <input> button control with name="submit" breaks <asp:LoginStatus> control on same page
Hey all,
I don't know if this has anything to do with Umbraco, or if this is an 'undocumented feature' from some other area, but I thought I would let the community know about this interesting situation:
I have a masterpage that uses an <asp:LoginView> with the standard <asp:LoginStatus> as part of the <LoggedInTemplate> section in order to facilitate users logging in and out
This all occurs in the header section of the master template, as you commonly see on webpages. On a child template of that master template I have a macro that creates a complex form which makes use of standard HTML <input> controls. On that form, there is a button sitting at the bottom unused (still developing the form) that just happens to look like this:
(In this form, 'submitting' the form simply indicates it is ready for processing, whereas 'saving' the form, accomplished through another button, is what is doing the Post) Now, I haven't gotten to dealing with the submit button yet, so it was just hanging out down there, not doing any harm, or so I thought. What I found though, is that the 'Logout' action via the <asp:LoginStatus> would not work on this one particular page. After a rigurous search through my code, I discovered that if I change the name of the button to anything besides 'submit', problem solved, but as long as there was a control of type="button" and with a name="submit" you could not log out while on that page through the <asp:LoginStatus> control.
Because I am still learning .NET, I am not certain what the root cause of this behavior is, but Umbraco does not seem likely to be at fault. Regardless, I though I should share with the community and see if someone with more expierence/knowledge could shed some light on the situation.
root of the cause is that there is also prob a javascript function called submit too.. and that is why you shouldn't use name="submit" on the button too.. the browser gets confused between the two...
or at least that's what I found to be the case when I stumbled on the same issue.
Yeah, I realized that of course there must be a naming issue overlap, it just seemed odd to me that the situation as described above should be allowed to occur, or if it is a known issue, why did I not see more documentation about it? I mean, one would think that on the asp.net websites with all the walkthrough and tutorials that they have regarding using the asp controls, specifically the asp:LoginStatus and related controls, there would be some warnings or cautionary statments like, "don't use the name 'submit' on any of your controls if you are using these asp controls..."
Thanks for the reply though Mike, I am glad to know I am not the only one who stubled across this issue!
Possible bug: html <input> button control with name="submit" breaks <asp:LoginStatus> control on same page
Hey all,
I don't know if this has anything to do with Umbraco, or if this is an 'undocumented feature' from some other area, but I thought I would let the community know about this interesting situation:
I have a masterpage that uses an <asp:LoginView> with the standard <asp:LoginStatus> as part of the <LoggedInTemplate> section in order to facilitate users logging in and out
This all occurs in the header section of the master template, as you commonly see on webpages. On a child template of that master template I have a macro that creates a complex form which makes use of standard HTML <input> controls. On that form, there is a button sitting at the bottom unused (still developing the form) that just happens to look like this:
(In this form, 'submitting' the form simply indicates it is ready for processing, whereas 'saving' the form, accomplished through another button, is what is doing the Post) Now, I haven't gotten to dealing with the submit button yet, so it was just hanging out down there, not doing any harm, or so I thought. What I found though, is that the 'Logout' action via the <asp:LoginStatus> would not work on this one particular page. After a rigurous search through my code, I discovered that if I change the name of the button to anything besides 'submit', problem solved, but as long as there was a control of type="button" and with a name="submit" you could not log out while on that page through the <asp:LoginStatus> control.
Because I am still learning .NET, I am not certain what the root cause of this behavior is, but Umbraco does not seem likely to be at fault. Regardless, I though I should share with the community and see if someone with more expierence/knowledge could shed some light on the situation.
Cheers!
- Josh
root of the cause is that there is also prob a javascript function called submit too.. and that is why you shouldn't use name="submit" on the button too.. the browser gets confused between the two...
or at least that's what I found to be the case when I stumbled on the same issue.
Hey Mike,
Yeah, I realized that of course there must be a naming issue overlap, it just seemed odd to me that the situation as described above should be allowed to occur, or if it is a known issue, why did I not see more documentation about it? I mean, one would think that on the asp.net websites with all the walkthrough and tutorials that they have regarding using the asp controls, specifically the asp:LoginStatus and related controls, there would be some warnings or cautionary statments like, "don't use the name 'submit' on any of your controls if you are using these asp controls..."
Thanks for the reply though Mike, I am glad to know I am not the only one who stubled across this issue!
Cheers!
is working on a reply...
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.