to retrieve userid & name
-
now I imported all tables of aspnetdb to my another database using aspnet_regsql command. it is ok. then In this database, I created only other user info table (including userid, name...) , beside aspnetdb's aspnet_Users table. Creating New user is also inserting into both tables. It is OK. now what I want to ask is: after one user is logged in, i want to take this userid and name and take them to another page using QueryString. how I have to do? please help me.
-
now I imported all tables of aspnetdb to my another database using aspnet_regsql command. it is ok. then In this database, I created only other user info table (including userid, name...) , beside aspnetdb's aspnet_Users table. Creating New user is also inserting into both tables. It is OK. now what I want to ask is: after one user is logged in, i want to take this userid and name and take them to another page using QueryString. how I have to do? please help me.
You already have the idea of using query string to pass your parameters to the next page and all you could have done is googled how to use query string, let's see if this helps:
//pass the parameters like so:
Response.Redirect( "home.aspx?userid=" + userid.Text + "&name=" + name.Text() )and on home.aspx page load event you can retrieve your parameters from the query string like so:
if( Request.QueryString[ "userid" ] != null && Request.QueryString[ "name" ] != null )
{
String userid = Request.QueryString[ "userid" ];
String name = Request.QueryString[ "name" ];
}
else
{
//the query strings do not exist/were not passed
}Want more: Passing variables between pages using QueryString[^] Happy coding, Morgs