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

Untitled

By: a guest on May 31st, 2012  |  syntax: None  |  size: 1.04 KB  |  hits: 26  |  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. The name xxx does not exist in the current context
  2. <LoggedInTemplate>
  3.     <b>Login ok ! </b><br />
  4.         <asp:FileUpload ID="FileUpload1" runat="server" />
  5.         <asp:SqlDataSource ID="SqlDataSource1" runat="server"
  6.         ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
  7.         InsertCommand="INSERT INTO aspnet_PicturesHome(pUrl) VALUES (@pUrl)"
  8.         SelectCommand="SELECT pID, pUrl FROM aspnet_PicturesHome">
  9.             <InsertParameters>
  10.                 <asp:ControlParameter Name="pUrl" Type="String" ControlID="FileUpload1" PropertyName="FileName"/>
  11.             </InsertParameters>
  12.         </asp:SqlDataSource>
  13. <asp:Label ID="Label1" runat="server" Text="Label">Foto upload: </asp:Label>
  14. <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Upload" />
  15. <br></br>
  16. </LoggedInTemplate>
  17.        
  18. FileUpload fu = LoginView1.FindControl("FileUpload1") as FileUpload;
  19.        
  20. protected void Page_Load(object sender, EventArgs e){
  21.  
  22. if(!this.isPostBack)
  23. {
  24.   if(!Context.User.IsInRole("admin"))
  25.   {
  26.      //disable controls
  27.   }
  28. }
  29. }