Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Access HttpContext.Current.User.Identity.Name as Parameter to SqlDataSource
  2. <SelectParameters>
  3.             <asp:ControlParameter ControlID="SelectLoadScanner1" DefaultValue="0" Name="loadId" PropertyName="loadId" />
  4.             <asp:SomeParameterType DefaultValue="" Name="username" PropertyName="HttpContext.Current.User.Identity.Name" />
  5.         </SelectParameters>
  6.        
  7. public string UserName
  8. {
  9.     get
  10.     {
  11.         if (HttpContext.Current == null || HttpContext.Current.User == null)
  12.             return null;
  13.         else
  14.             return HttpContext.Current.User.Identity.Name;
  15.     }
  16. }