Password Textbox - Easy [Resolved]
I am just starting out with ASP.NET and I wanted to know what the difference is between
the Web Forms controls and the HTML controls (besides the Form part of it)? I am making a very simple login page
and I wanted a password textbox and I see this is only available when using an HTML textbox?
Re: Password Textbox - Easy
HTML Controls can not have server side events, and therefore you cannot write VB code behind say a click event.
Here is the code for 2 buttons. One a server side control, the other a HTML one.
Code:
<body>
<form id="Form1" method="post" runat="server">
<asp:Button id="btnServer" runat="server" Text="Button"></asp:Button>/asp:Button>
<INPUT type="button" value="Button">
</form>
</body>
So, with btnServer, the ASP.NET web control, you can do:
Code:
Private Sub btnServer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnServer.Click
'code here
End Sub
Does that help?
I am not that good at web, but I am sure you can put javascript code for a HTML button.
Woka
Re: Password Textbox - Easy
Umm, ok. With the thml button it submits and the form button is clicks. Which is the better of the two to use?
Re: Password Textbox - Easy
Well, since you are writting a .NET app, I would use .NET controls :D
I write tables and stuff manually, in fact I write everything manually.
When writting tags etc you have intellisence. I canm't spell.
I only use the designer to drop in WebControls I have written.
To make the control a web control add the runat="Server" tag to it, that's if it supports it. Not all controls can have events etc.
Writting an example login page for you.
Woka
Re: Password Textbox - Easy