Sunday 15 September 2013

ASP.NET / C# Respond.Redirect function -


I would like to know after id = , i id user, i created query on another page

  SqlConnection con = New SqlConnection (ConfigurationManager.ConnectionStrings ["RegisterConnectionString"]. ToString ()); SqlCommand CMD = New SQL Commands ("Choose from ID where ID = @ bid", Kon); SqlDataAdapter APD = New SQL DataAdapter (CMD); Dataset ds = new dataset (); Cmd.Parameters.AddWithValue ("@bit", page request .QueryString ["ID"]. ToString ()); Con.Open (); Apd.phil (ds, "registration"); Cmd.ExecuteNonQuery (); Con.Close (); FormView1.DataSource = DS; FormView1.DataBind (); //  

There is a query string -

  feedback. Redirect ("users.aspx? Id = & lt; some user for get ID;);  

Here is the part that I want to know how it works

My "project is": Whenever you are logged in as the user with id = 1 , do you have any page users.aspx? Id = 1 and you get information for user 1, if the user logs you 2 information you get information A2 etc.

Normally when you pass an ID through a URL You can request the parameters of your request using URL. Param ["id"];

Say that you want to display the user's information on the page, on page load, you have

  Int id = request. Param ["id"]; // Some data / user content to return / display user data from the database Sector more code  

request. Param will basically have to check the URL for any parameter.

Example:

If you use

  Request.Param ["id"]; // it will return 1  

and if you use the

  request .Param ["somethingelse"]; // it will return 27  

No comments:

Post a Comment