Jun 20, 2011

pass value between aspx page(Updating)

Pass value between aspx page
  • Pass by HttpContent

webpage1.aspx

String[] arraylist={"1","2","3"}; 
HttpContent.Current.Items["ArrayString"] = arraylist;
 
webpage1.aspx
String[] array= HttpContent.Current.Items["ArrayString"]
 
Note: 
HttpContent can not pass value with Response.Redirect
 
  • Pass by Session 

webpage1.aspx

String strName="Agrond"; 
HttpContent.Current.Items["String"] = strName;
 
webpage2.aspx

String strNamePassed=HttpContent.Current.Session["String"].ToString();
  

Note: Item and Session  can pass the object

No comments:

Post a Comment