7 ) DATA TRANSFORMISSION ( SESSION ,QUERYSTRING )
* DATA TRANFERMISSION *
- Data transefermission is a process for Transfering Data one page to another page it called state management .
There are falling state management usend in a Dotnet.
- Session
- Querystring
- Viewstate
- Cookies
- Application State
Session
- Session is a state management
- Session default 60 sec
- secure data transfer
Q ) How to create a session
:- All session create inside the event
1st page pe session create krte hai aur second page pe show krte hai
Syntax :- Session ["variable name"] = Controle Name
Ex . 1 ) Textbox :- Session["roll"] = TextBox1.Text ;
2 ) DropDownList :- Session["gender"] = DropDownList1.Text ;
3 ) Label :- Session["pimage"] = Label1.Text ;
4 ) Iamge :- Session["image1"] = Image1.ImageUrl;
and etc controles
Session is to create unlimited of website
Q ) How to use session
- Session is used in Pageload
- Session always received in form of string ( int to string )
2nd Page
Syntax :- Controle = (String ) Session ["vaiable name"] ;
Ex :- 1 ) Label :- Label1.Text = (string)Session["roll"] ;
2 ) Iamge :- Image1.ImageUrl = (string)Session["image1"] ;
QUERYSTRING
Transfer data with url use Querystring
- Querystring is use to (Responce.Redirected ) method
- Querystring is use to Questionmark symbol ?
- Querystring is to be create inside the event
- Querystring is use to page load event
Q ) How to create Querystring ( 1st page )
Syntax :- Response.Redirect("Pagename.Aspx?variablename="+Controlename + "&variablename" );
Ex :- Response.Redirect("querystrinnpage2.aspx?email="+TextBox1.Text + "&mobile=" + TextBox2.Text);
Q ) how to use Querystring ( 2nd )
- :- Is use to page load event Syntex :- control=Reqest.Querystring["variable"];
- Ex :- Label1.Text = Request.QueryString["email"] ;
Querystring
Comments
Post a Comment