code_junkie

How to pass Page as ref parameter to a function

Nov 13th, 2011
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public partial class HomePage : System.Web.UI.Page
  2. {
  3. protected void Page_Load(object sender, EventArgs e)
  4. {
  5. if(!SetupUserPermission.isSessionExpired())
  6. {
  7. string UserId = Session["UserId"].ToString();
  8. SetupUserPermission.SetupUserRights(ref this.Page, Convert.ToInt32(UserId));
  9. }
  10.  
  11.  
  12. }
  13. }
  14.  
  15. Page tmp = Page;
  16. SetupUserPermission.SetupUserRights(ref tmp, Convert.ToInt32(UserId));
  17. Page = tmp;
  18.  
  19. SetupUserPermission.SetupUserRights(this, ...);
Add Comment
Please, Sign In to add comment