|
-
Jun 18th, 2010, 09:26 AM
#1
Thread Starter
New Member
How to - Assign a value to a FormView Field?
Hello,
Well thanks to all I now can reference a field in the formview, but, assigning it a value is fighting me.
I want to assign the UserName field in the formview with the login name from the Master (HttpContext.Current.User.Identity.Name).
(A) I tried the likes of: FormView1.FindControl("UserName").DefaultValue = username but of course that doesn't work.
(B) Alternatively, I tried to edit the SQL so that I passed it the HttpContext.Current.User.Identity.Name but didn't have any luck.
InsertCommand="INSERT INTO [TechUserName] ([CertName], [CertLevel], [CertLast], [CertFreq], [CertDue]) VALUES (@temp1, @CertLevel, @CertLast, @CertFreq, @CertDue)"
temp1.text=(HttpContext.Current.User.Identity.Name)
-
Jun 18th, 2010, 12:58 PM
#2
Re: How to - Assign a value to a FormView Field?
Have you tried just using the LoginName control?
http://msdn.microsoft.com/en-us/libr...loginname.aspx
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|