Newbie question

  • Thread starter Thread starter Sjaak
  • Start date Start date
S

Sjaak

Hi there,

I'm starting to learn ASP.NET from this book and there is something I
don't really understand.

See the following code :
-------
<script runat="server">
Public Sub btnLogin_Click(ByVal sender As Object, ByVal e AS
System.EventArgs)
Dim objSMTP As System.Web.Mail.SmtpMail
Dim ret as object
objSMTP.Send("(e-mail address removed)", "(e-mail address removed)", "test
mail", "test")
End Sub
Public Sub Button2_Click(ByVal sender As Object, ByVal e AS
System.EventArgs)
Dim objSMTP As System.Web.Mail.SmtpMail
objSMTP.Send("(e-mail address removed)", "(e-mail address removed)", "test
mail", txtMessage.value)
End Sub
</script>

<!-- futher down in the form -->

<asp:button id="btnLogin" Text="Login" Runat="server"></asp:button>

<input type="button" id="button2" runat="server" value="server side
html button" onserverclick="Button2_Click" name="Button2">

------------------------

There is a button 'Login' and 'Server side html button'.
What is the difference between these buttons??

How would I make the login button a 'server side button'?

Thanks!

BTW: Is it just me, or is ASP.NET harder to learn then PHP or
Coldfusion?
 
Hi,

The first button named btnLogin, is an ASP.NET web server control, however
button2 is an HTML server control.

Don't get confused. The btnLogin is already a server-side control. You can
attach an event handler to it, so that when the event occurs, the event
handler is run on the server.

Hope this explains :)

Thanks,
Noble Lesmana
 
Back
Top