user controls - .NET imagebutton - does it require codebehind? -
I have a simple to log in to a member area on a website. NET user control is created (the site is powered by Umbraco and uses its membership provider).
It worked fine until I changed the submit button to an image button on the log-in user control. Now it does not seem to be presenting everything - it reloads it after clicking on the page and does not log the user.
At the moment, control is being inserted as a standard .aspx usercontrol, without compiling it in a DLL - which works with standard submit buttons but does not have the image button with it To get an image button, the code behind the code is required, so I have to compile it, is it right?
I can probably tell that I am a total noob on .NET, so any advice would be very good.
Here I have the code:
<% @ Control language = "C #" AutoEventWireup = "true"%> & Lt; ASP: login id = "login1" run = "server" & gt; & Lt; LayoutTemplate & gt; & Lt; Fieldset & gt; & Lt; Legend & gt; Login details & lt; / Legend & gt; & Lt; Div & gt; & Lt; ASP: Labels ID = "Username Labell" Runat = "Server" Associated ControlID = "Username" & gt; User Name: & lt; / Asp: Label & gt; & Lt; Asp: text box id = "user name" run = "server" & gt; & Lt; / Asp: text box & gt; & Lt; Asp: RequiredFieldValidator ID = "UserNameRequired" runat = "server" ControlToValidate = "UserName" error message = "username is required." Tooltip = "Username is required." ValidationGroup = "ctl00 $ Login1" & gt; * & Lt; / ASP: RequiredFieldValidator & gt; & Lt; / Div & gt; & Lt; Div & gt; & Lt; Asp: Label ID = "PasswordLabel" runat = "server" Associated ControlID = "Password" & gt; Password: & lt; / Asp: Label & gt; & Lt; ASP: Text Box ID = "Password" Runat = "Server" System Code = "Password" & gt; & Lt; / Asp: text box & gt; & Lt; Asp: RequiredFieldValidator id = "PasswordReparded" runat = "server" controltovatidet = "password" error message = "password is required." Tooltip = "Password Required." ValidationGroup = "ctl00 $ Login1" & gt; * & Lt; / ASP: RequiredFieldValidator & gt; & Lt; / Div & gt; & Lt; Div & gt; & Lt; ASP: Checkbox ID = "Remember" run = "server" text = "Remember me next time." / & Gt; & Lt; / Div & gt; & Lt; Div & gt; & Lt; ASP: Liller Id = "Failure Text" Runat = "Server" enabledVeget = "False" & gt; & Lt; / Asp: literal & gt; & Lt; / Div & gt; & Lt; / Fieldset & gt; & Lt; Asp: ImageButton id = "loginbuttons" runat = "server" src = "~ / css / img / btn_log-in.png" CssClass = "rollover" validation group = "ctl00 $ login1" /> & Lt; Br / & gt; & Lt; Br / & gt; & Lt; Div style = "background: # fc0" & gt; STATUS (to be removed) & lt; Asp: LoginStatus ID = "LoginStatus1" LoginText = "Log in or register" LogoutText = "Logout" runat = "server" /> & Lt; / Div & gt; & Lt; / LayoutTemplate & gt; & Lt; / ASP: Login & gt;
The only thing that worked on the version was that & lt; Asp: ImageButton
Adorable ... was:
Just say, you need to compile the DLL again.
The reason that there is a pagename.designer.cs file that gets updated when you change a control in the markup and which is a code file that is only updated on recompilation.
HTH!
Comments
Post a Comment