Thursday 16 February 2012

How To Pass Values From One aspx Page Textbox/Variable to Another aspx Page Textbox/Variable In Asp.Net Using C#


How To Pass Values From One aspx Page Textbox/Variable to Another aspx Page Textbox/Variable In Asp.Net Using C#



The Following Example Shows How To Pass Values From One aspx Page Textbox/Variable to Another aspx Page Textbox/Variable In Asp.Net Using C#


You Can Pass The Value From One Page To Another Page In Asp.Net Using Query String Like This :


protected void btnnewthread_Click(object sender, EventArgs e)
    {
        try
        {
            DataSet ds = new DataSet();
            ds = SelectCatagoryID();
            int ID = Convert.ToInt32(ds.Tables[0].Rows[0][0]);

            Response.Redirect("Newthread.aspx?val=" + ID );          
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }



You Can Retrive That Value Like This :

protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            catid  = Convert.ToInt32(Request.QueryString["val"]);
            LoginSession();
            //SelectCatagoryID();
            //NoBack();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
^ Scroll to Top Twitter Bird Gadget