Guest User

Untitled

a guest
Aug 16th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. Parse and retrieve properties from ViewState?
  2. //store value in viewstate
  3. ViewState["someValue"] = "Foo";
  4.  
  5. //retrieve value from viewstate
  6. string someValue = ViewState["someValue"].ToString();
  7.  
  8. private string GetValue
  9. {
  10. get
  11. {
  12. string result = string.empty;
  13.  
  14. if (ViewState["someID"] != null)
  15. {
  16. result = (string)ViewState["someID"];
  17. }
  18.  
  19. return result;
  20. }
  21. set
  22. {
  23. ViewState["someID"] = value;
  24. }
  25. }
Add Comment
Please, Sign In to add comment