2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by amitshrivas
0

hello, I 'm still a noob at programming in vb.net
I have a little problem. I 'm trying to get my selected rows to another page. I already can select my rows with checkboxes but I don't know how I can pass them through a session to another page.
hopefully someone can help me.

greetz

Are u using GridView control and get connected by database...
is that so..
then
u must be knowing Global.asax
inside session_start
declare a session variable..

Session["name"]=null;

On GridView_Selected change

int index = GridView1.SelectedIndex;
        for (int i = 1; i < GridView1.Rows[index].Cells.Count; i++)
        {
            Response.Write(GridView1.Rows[index].Cells[i].Text);
            Session["name"] += GridView1.Rows[index].Cells[i].Text+".";
        }

and how to retrive the value from session..

string[] splitData;
        if (Session["name"] == null)
        {
        }
        else
        {
            string valuefromsession = Session["name"].ToString();
            splitData = valuefromsession.Split('.');
            for (int i = 0; i < splitData.Length-1; i++)
            {
                Response.Write("Name :" + splitData[i].ToString() + "<br/>");
            }
        }

i hope this will help u

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.