-
new with asp.net
I began studying asp.net this week... after installing the framework and web-matrix on my computer i tried to some examples that were on the cd from the book i bought (asp.net unleashed). For some reason the view-state is not preserved when i submit... Dit i forget to configure something? Any help would be greatly appreciated.
Code:
<%@ Page %>
<script runat="server">
Sub Button_Click( s As Object, e As EventArgs )
entries.innerHtml = "<hr>" & username.Value & "<p>" & comments.Value & entries.innerHTML
End Sub
</script>
<html>
<head>
<title>Guestbook.aspx</title>
</head>
<body>
<form runat="Server">
<b>Username:</b>
<br />
<input id="username" type="text" size="30" runat="Server" />
<p>
<b>Comments:</b>
<br />
<textarea id="comments" rows="10" cols="60" runat="Server"></textarea>
</p>
<p>
<input type="submit" value="Add Comment" runat="Server" onserverclick="Button_Click" />
<span id="entries" runat="Server">
</span>
</p>
</form>
</body>
</html>
-
Is that code the source view from the browser or a cut and paste of the code from Web Matrix?
-
In your @ Page directive add EnableViewState="True"
-
to answer bukhix question: webmatrix-code, the browser is only showing the fields...without text
After enabling the viewstate explicitly (which i didn't think is neccesary???) nothing changes... The browser isn't showing any of the asp-controls like buttons or images or anything in all of the code-examples and when i make a page myself it's the same thing...
any ideas?
-
I think i found the source of the problem... I think it should be ok when i run the "\WINNT\Microsoft.NET\Framework\v1.0.3705\aspnet_regiis.exe" -i command...
only problem: there is no such .exe in that folder nor on my computer...i'm really stuck here...
-
it seems that asp.net is not supported under nt4 ??? is this a secret?