Click here to Skip to main content
16,008,942 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Frnds,

I have created 2 forms.. its dept id fetch from dept master(Grid view)... I need Values from that Gridview to another window text box.. am new to this technology any one can help me.
Posted

 
Share this answer
 
v3
Comments
vignesh war 13-Feb-14 23:21pm    
I can't understood... I have written this code to gridview:
for (int i = 0; i < GridView1.Rows.Count; i++)
{
if (GridView1.SelectedIndex == i)
{
String name = GridView1.Rows[i].Cells[0].Text; //Gets the data value in the grid;
Session["Value"] = name;
Server.Transfer("InPatientFinal.aspx");
// Response.Redirect("InPatientFinal.aspx");

}
}
vignesh war 13-Feb-14 23:24pm    
that code is didnt go values to another window. it in same window goes to next tab.. can u give code for one window to another window..
[no name] 13-Feb-14 23:27pm    
Check the updated solution..
vignesh war 13-Feb-14 23:45pm    
ya same problem only didnt goes to another window.. it open is same window next tab
[no name] 13-Feb-14 23:48pm    
Check the updated solution..
 
Share this answer
 
Comments
vignesh war 14-Feb-14 0:00am    
same problem JoCodes... Didnt goes to next window I have already tried this code also..
vignesh war 14-Feb-14 0:09am    
Ya I have tried all of methods from net.. same problem give ur mail id i send video wts my problem.. then u r understood.. send some codes..
JoCodes 14-Feb-14 0:10am    
You can post the code in the Question and the issue you facing. We can help you to resolve it.
vignesh war 14-Feb-14 0:24am    
this code for gridview Selected values:
for (int i = 0; i < GridView1.Rows.Count; i++)
{
if (GridView1.SelectedIndex == i)
{
String name = GridView1.Rows[i].Cells[0].Text; //Gets the data value in the grid;
Session["Value"] = name;
Server.Transfer("InPatientFinal.aspx");
// Response.Redirect("InPatientFinal.aspx");

}
}
vignesh war 14-Feb-14 0:25am    
this is Main page: that gridview values come in this text box:
if (Page.IsPostBack)
{
string RowValue = Convert.ToString(Session["Value"]);
txtDeptId.Text = RowValue;
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900