David Megnin
asked on
Insert Server Variable into GridView upon editing.
In my GridView I'd like to put the equivilant of this: Request.ServerVariables("A UTH_USER") into the column called "ModifiedBy".
The idea is when someone edits a row their logged in user name is put into the "ModifiedBy" column.
The idea is when someone edits a row their logged in user name is put into the "ModifiedBy" column.
ASKER
What I want is to grab the Server Variable for the logged in user as a parameter and plug it into the GridView.
The ModifiedBy field is currently a BoundField, but I could change it to a TemplateField. I just don't know how to get the Server Variable for the logged in user value into the GridView. I expect it will have to be done in the VB code behind, but I'm not sure if it can't be done in the GridView markup some how.
Text='<%# Bind([Server Variable for logged in user]) %>' ??
The ModifiedBy field is currently a BoundField, but I could change it to a TemplateField. I just don't know how to get the Server Variable for the logged in user value into the GridView. I expect it will have to be done in the VB code behind, but I'm not sure if it can't be done in the GridView markup some how.
Text='<%# Bind([Server Variable for logged in user]) %>' ??
This is your required server variable:
Text='<%# Bind([this.Page.User.Ident ity.Name]) %>'
Text='<%# Bind([this.Page.User.Ident
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
With square brackets, round brackets or no brackets?
ASKER
Text='<%# Bind([Page.User.Identity.N ame]) %>'
Text='<%# Bind([Request.LogonUserIde ntity.Name ]) %>'
Text='<%# Bind(Page.User.Identity.Na me) %>'
Text='<%# Bind(Request.LogonUserIden tity.Name) %>'
All those give me a Parse Error: A call to Bind was not well formatted.
Text='<%# Bind([Request.LogonUserIde
Text='<%# Bind(Page.User.Identity.Na
Text='<%# Bind(Request.LogonUserIden
All those give me a Parse Error: A call to Bind was not well formatted.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I ended up going a different route, but mas_oz2003's help lead me down the right path. I used a different method, but gave mas_oz2003 the points for the aid.
ASKER
Thanks for the help. It lead me in the right direction.
http://msdn.microsoft.com/en-us/library/ms178366.aspx