how can i pass a variable from a page to another in asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • simonakiki
    New Member
    • Sep 2007
    • 23

    how can i pass a variable from a page to another in asp.net

    hi

    how can i pass a variable from a page to another in asp.net


    10x
  • dip_developer
    Recognized Expert Contributor
    • Aug 2006
    • 648

    #2
    Originally posted by simonakiki
    hi

    how can i pass a variable from a page to another in asp.net


    10x
    plenty of methods for this.....you can use QueryString when you are redirecting your page.......you can save your variable value in a Session variable and access it from another page,you can use Viewstate.......

    but please learn these very basic things from a book(or you can have GOOGLE anytime)....don t go for readymade answers........

    Comment

    • simonakiki
      New Member
      • Sep 2007
      • 23

      #3
      Originally posted by dip_developer
      plenty of methods for this.....you can use QueryString when you are redirecting your page.......you can save your variable value in a Session variable and access it from another page,you can use Viewstate.......

      but please learn these very basic things from a book(or you can have GOOGLE anytime)....don t go for readymade answers........

      ok 10x for u
      i will search for all basic things from google befor asking u

      Comment

      • mady1380
        New Member
        • Sep 2006
        • 18

        #4
        Hi there

        Guys , happens some people didnt go through their books so well or whatever the reason.

        I think the forum is for everybody. so chill guys...

        and here's your solution..

        ************PAG E YOU ARE SENDING FROM***********
        //variable
        int EmployeeID=1;

        Response.Redire ct("EmployeeDet ails.aspx?Edit= " + EmployeeID);

        ***********PAGE YOU WANT TO RECEIVE ************

        int EmployeeID = Convert.ToInt32 (Request.QeuryS tring("Edit"));

        And you can get you EmployeeID....


        i hope it helps you out...


        Cheers
        mady

        Comment

        Working...