HighTechTalks DotNet Forums  

assigning init value to control in Formview InsertItemTemplate

Dotnet Data Tools microsoft.public.dotnet.datatools


Discuss assigning init value to control in Formview InsertItemTemplate in the Dotnet Data Tools forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
E. Kwong
 
Posts: n/a

Default assigning init value to control in Formview InsertItemTemplate - 11-07-2006 , 01:26 PM






Am a newbie on VS2005. I've created an input form using Formview's
InsertItemTemplate control. There's one field I want to initialize to
today's date:

Protected Sub frmMain_PreRender(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim strToday As String = DateTime.Now.ToString("d")
If (frmMain.CurrentMode = FormViewMode.Insert) Then
(TextBox)frmMain.FindControl("txtPubDate").text = strToday
End If
End Sub

But I keep getting syntax error at the assignment statement. I've played
with the placements of the parentheis but it still doesn't work.

Have spent a lot of time on "simple" thing like this. Any insight
appreciated. Thanks.



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.