Autenticazione basata su WebForm
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings/> <system.web> <authentication mode="Forms"> <forms name="FormAuth" loginUrl="login.aspx"/> </authentication> <compilation debug="true"/></system.web> <location path="default.aspx"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location> </configuration>
<%@ Page Language="VB" %> <script language="VB" runat="server"> Sub btnLogin_OnClick(Src As Object, E As EventArgs) If txtUsername.Text = "pippo" And txtPassword.Text = "pippo" Then FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, True) Else lblInvalid.Text = "Non autenticato" End If End Sub </script> <html> <body> <form name="Form1" runat="server"> <h2> Login</h2> <table> <tr> <td style="width: 3px"> Username:</td> <td> <asp:TextBox id="txtUsername" runat="server" /></td> </tr> <tr> <td style="width: 3px"> Password: </td> <td> <asp:TextBox id="txtPassword" TextMode="password" runat="server" /></td> </tr> <tr> <td style="width: 3px"> </td> <td> <asp:Button id="btnLogin" runat="server" text="Login" OnClick="btnLogin_OnClick" /></td> </tr> <tr> <td style="width: 3px"> </td> <td> <asp:Label id="lblInvalid" runat="server" /></td> </tr> </table> <!--Note--><br /> Per autenticarti scrivi <br /> Username: "pippo" <br /> Password: "pippo" </form> </body> </html>
<%@ Page Language="VB" %> <script language="VB" runat="server"> Sub btnLogout_OnClick(Src As Object, E As EventArgs) FormsAuthentication.SignOut End Sub </script> <html> <body> <p> Benvenuto. </p> <form id="Form1" runat="server"> <asp:Button id="btnLogout" text="Log Out" runat="server" OnClick="btnLogout_OnClick" /> </form> </body> </html>
Scarica il Codice...
Script C# per tutte le esigenze: database, sessioni, file, contatori, stringhe, date, e-mail, e tanto altro.
Manuale completo di C# per principianti e non.
Script VB.Net Visual Basic .net: database, sessioni, file, contatori, stringhe, date, e-mail, e tanto altro ancora.
Manuale di SQL con particolare attenzione a T-SQL di Microsoft SQL Server
Tecniche di posizionamento indicizzazione e ottimizzazione dei siti web per nei motori di ricerca
Manuale completo sui CSS per principianti e non.
HTML 5 è un linguaggio di markup utilizzato per la strutturazione e il contenuto delle pagine Web.
CSS 3 è l'ultima evoluzione dei fogli di stile CSS. Contiene molte novità come angoli arrotondati, ombre, sfumature, transizioni o animazioni.
jQuery è una libreria JavaScript cross-platform progettata per semplificare lo scripting lato client.