Wednesday, March 28, 2012

web control is generating an error - help required

Hi All

I'm new here and to asp.net. I'm on Hour 2 of SAMS ASP.NET in 24 hours, and one of the exercises is creating a web control.

The following code when run on either IIS5 (1.1 framework) or the Web Matrix browser gives an error:


<%@dotnet.itags.org. Page Language="VB" %>
<script runat="server"
Sub Page_Load(sender as Object, e as EventArgs)
currentDT.value = DateTime.Now
End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:TextBox id="currentDT" runat="server"></asp:TextBox>
<!-- Insert content here -->
</form>
</body>
</html>

I get the following error:


'value' is not a member of 'System.Web.UI.WebControls.TextBox'

I have installed the version of Web Matrix that is supplied with the book and I have installed the most recent version from www.asp.net. The error is the same.

As this is the first exercise with Web Controls, I assume that the error is on my PC setup. Should I re-install the 1.1 framework? A similar exercise using HTML instead of the web control worked, so I know that the asp.net engine is working!

I apologise in advance for my poor syntax in the descriptions!

Cheers

MowieTry:


currentDT.Text= DateTime.Now.ToString()

Great, I understand that
.value
is not valid for TextBox.

Thanks for your response.

Mowie

0 comments:

Post a Comment