Thursday 6 December 2012

Queristring in vb.net with example | how to use queristring in asp.net


how to use queristring in vb.net .
if we want to pass the information from one page to another IN  .aspx page
in c# or vb.net we need some object which will give flow of data from
one page to another page.so , that is session and queristring.
in this article we will learn how to use response.redirect  to pass data from one page to another page.
Response.Redirect("Default.aspx?from=" & txtfrom.Text & "  &to=" &
txtto.Text & " &last=" & txtlast.Text)
 queristring do same functionality in c# and vb but using syntax is little bit different.
in c# we use + sign whereas in vb we use & sign.
Response.Redirect("Default2.aspx?from=" & txtfrom.Text & "  &to=" &

txtto.Text & " &last=" & txtlast.Text)

above code shows that passing value from first default.aspx to
default2.aspx. where variable from is storing data of txtfrom text box
and to is storing txtto text box value .this value will go to the
default2.aspx where we can utilize that values.

so lets start page 2 default2.aspx.
 we can store from and to value in other variable for use purpose.
 Dim sr as integer
sr=from
Dim dr as integer
dr=to

and we can use it any where on same page .
but remember about  " " and & & sign . many developers like me find difficulties to solve this problem.

basic problem comes when we need to pass more than one paramater then we think about syntax  like where to use & and  '" and "","".
there are very small , simple and very useful think. so , do it very carefully. Don't play with it just work with it.


Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: