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 -->
<input type="text" id="txtMessage" name="txtMessage" size="50"
runat="server">
<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">
------------------------
The line :
<input type="text" id="txtMessage" name="txtMessage" size="50"
runat="server">
is ofcourse an input field. Now I would like to change this input
field into
a 'controltype' (not sure if that's what it's called) field like :
<asp:TextBox ID="txtmessage" Runat="server"></asp:TextBox>
When I use this code I get the error : The ID 'txtmessage' is already
used by another control. Why?
What ID should I give it?
and what should I change in the code :
---
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)
---
To get it to work with the new ID?
Hope this makes sense and the question isn't to stupid %-) This
asp.net is really puzzeling me.
Thanks for any help!!
Steven.
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 -->
<input type="text" id="txtMessage" name="txtMessage" size="50"
runat="server">
<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">
------------------------
The line :
<input type="text" id="txtMessage" name="txtMessage" size="50"
runat="server">
is ofcourse an input field. Now I would like to change this input
field into
a 'controltype' (not sure if that's what it's called) field like :
<asp:TextBox ID="txtmessage" Runat="server"></asp:TextBox>
When I use this code I get the error : The ID 'txtmessage' is already
used by another control. Why?
What ID should I give it?
and what should I change in the code :
---
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)
---
To get it to work with the new ID?
Hope this makes sense and the question isn't to stupid %-) This
asp.net is really puzzeling me.
Thanks for any help!!
Steven.