Wonder if someone can help me? Am V new to ASP.NET and learning very slowly
I
have a detailsview control and in it I have asp:textbox fields (Via a ItemTemplate).. I have
created this sub and want it to auto populate the textbox's on page load....
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If Not Page.IsPostBack Then
dteCommentDate.Text = My.Computer.Clock.LocalTime.Date
txtPostId.Text = Request.QueryString("news")
End If
End Sub
Now the weird this is its asking me to declare dteCommentDate & txtPostId which are textbox's in my Details view..
BUT when I tried it out this code with just normal asp:textbox not in a details view control
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
TextBox1.Text = My.Computer.Clock.LocalTime.Date
End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</asp:Content>
This works fine
... I am very confused can someone shed some light please??