ukdave
New member
Hi
Sorry about this! such a junior posting but this is my first attempt and I have spent 3 hours trying to fathom out what I have done wrong. Please help.
I saw a snippet of code in the book and understood what it was saying. Thought nevertheless I would try to put it into practice and actually type it all in and display result on the screen. Expected it to output "ASP.NET is neat"
As you have guessed it didn't! Just the word "Answer:"
Please help - here is what I typed and saw in the Web Matrix All code.
I realise I haven't got a clue at the moment but would appreciate your assistance please.
Code:<%@ Page Language="VB" %>
<script runat="server">
Sub word(sender as Object, e as EventArgs)
Dim firstWord as String = "ASP.NET"
Dim secondWord as String = "is"
Dim thirdWord as String = "neat"
Dim sentence as String
sentence = firstWord & " " & secondWord & " " & thirdWord & "."
result.Text= sentence
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<p>
Answer:
<asp:Label id="result" runat="server" Width="229px"></asp:Label>
</p>
</form>
</body>
</html>
Is it something I have done wrong with that "Sub word"routine, because I think it might be.
Thanks and apologies for such a basic question, but I have to start somewhere I suppose!
David
Sorry about this! such a junior posting but this is my first attempt and I have spent 3 hours trying to fathom out what I have done wrong. Please help.
I saw a snippet of code in the book and understood what it was saying. Thought nevertheless I would try to put it into practice and actually type it all in and display result on the screen. Expected it to output "ASP.NET is neat"
As you have guessed it didn't! Just the word "Answer:"
Please help - here is what I typed and saw in the Web Matrix All code.
I realise I haven't got a clue at the moment but would appreciate your assistance please.
Code:<%@ Page Language="VB" %>
<script runat="server">
Sub word(sender as Object, e as EventArgs)
Dim firstWord as String = "ASP.NET"
Dim secondWord as String = "is"
Dim thirdWord as String = "neat"
Dim sentence as String
sentence = firstWord & " " & secondWord & " " & thirdWord & "."
result.Text= sentence
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<p>
Answer:
<asp:Label id="result" runat="server" Width="229px"></asp:Label>
</p>
</form>
</body>
</html>
Is it something I have done wrong with that "Sub word"routine, because I think it might be.
Thanks and apologies for such a basic question, but I have to start somewhere I suppose!
David