Click here to Skip to main content
15,885,546 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Buttons and plaintext in DataGrid column? Pin
Steve Echols26-Jun-07 17:47
Steve Echols26-Jun-07 17:47 
QuestionRegular Expression Pin
VK-Cadec26-Jun-07 10:01
VK-Cadec26-Jun-07 10:01 
AnswerRe: Regular Expression Pin
Ed.Poore26-Jun-07 10:37
Ed.Poore26-Jun-07 10:37 
GeneralRe: Regular Expression Pin
VK-Cadec27-Jun-07 1:15
VK-Cadec27-Jun-07 1:15 
QuestionLocal Client printin using .net Pin
jeguzmanv26-Jun-07 9:01
jeguzmanv26-Jun-07 9:01 
AnswerRe: Local Client printin using .net Pin
Ed.Poore26-Jun-07 10:38
Ed.Poore26-Jun-07 10:38 
AnswerRe: Local Client printin using .net Pin
Christian Graus26-Jun-07 11:05
protectorChristian Graus26-Jun-07 11:05 
QuestionFill gridview with other form's data Pin
kjosh26-Jun-07 8:49
kjosh26-Jun-07 8:49 
Hi,

I have two apsx pages. In the first aspx page I have one gridView and a linkbutton under gridview. When the user clicks on LinkButton it will take you to the next aspx page. In the second aspx page I have 2 text boxes and one button Insert. The user enter some data into text boxes and clicking on Insert button will take him to the first aspx page and fill the textboxes data to Gridview.

In the first aspx page my code is like this:

Page_Load()

{

GridView1.DataSource = (System.Data.DataTable)Session["dta"];

GridView1.DataBind();

dta = (System.Data.DataTable)CreateDataTableA();

if (!IsPostBack)

{


Session["dta"] = dta;



}

}

//This is for link button click event.

protected void LBAddPartner_Click(object sender, EventArgs e)

{


Response.Redirect("PartnerDistrict.aspx");


}

protected System.Data.DataTable CreateDataTableA()

{

System.Data.DataTable aTable = new System.Data.DataTable();

DataColumn dtCol;

// Create ID column and add to the DataTable.

dtCol = new DataColumn();

dtCol.DataType = System.Type.GetType("System.String");

dtCol.ColumnName = "District_ID";

dtCol.AutoIncrement = false;

dtCol.Caption = "District_ID";

dtCol.ReadOnly = false;

dtCol.Unique = false;

// Add the column to the DataColumnCollection.

aTable.Columns.Add(dtCol);

// Create Name column and add to the table

dtCol = new DataColumn();

dtCol.DataType = System.Type.GetType("System.String");

dtCol.ColumnName = "District_Name";

dtCol.AutoIncrement = false;

dtCol.Caption = "District_Name";

dtCol.ReadOnly = false;

dtCol.Unique = false;

aTable.Columns.Add(dtCol);

return aTable;

}



In the second page:

//Insert button click:

protected void Button1_Click(object sender, EventArgs e)

{


dta = (System.Data.DataTable)Session["dta"];

DataRow dr = dta.NewRow();

dr[0] = txtboxDID.Text.ToString();

dr[1] = txtBoxDName.Text.ToString();

dta.Rows.Add(dr);

//Response.Redirect("Default.aspx");

Response.Redirect("Default.aspx");

txtboxDID.Text = "";

txtBoxDName.Text = "";

}

My problem is I the gridview (datatable) showing only the last inserted record only . WhereI mean in which event I have to put this line Session["dta"]=dta in first aspx page to persist all records.

Thanks in advance

AnswerRe: Fill gridview with other form's data Pin
Christian Graus26-Jun-07 11:06
protectorChristian Graus26-Jun-07 11:06 
QuestionUpdatePanel with Radio buttons Pin
cisco210326-Jun-07 7:54
cisco210326-Jun-07 7:54 
QuestionLarge Stored Proceedure Pin
oskardiazdeleon26-Jun-07 5:57
oskardiazdeleon26-Jun-07 5:57 
AnswerRe: Large Stored Proceedure Pin
Christian Graus26-Jun-07 11:12
protectorChristian Graus26-Jun-07 11:12 
QuestionHow can I get an attribute of a DropDownList item using javascript? Pin
Martin_26-Jun-07 5:40
Martin_26-Jun-07 5:40 
AnswerRe: How can I get an attribute of a DropDownList item using javascript? Pin
kubben26-Jun-07 7:49
kubben26-Jun-07 7:49 
GeneralRe: How can I get an attribute of a DropDownList item using javascript? Pin
Martin_26-Jun-07 7:54
Martin_26-Jun-07 7:54 
GeneralRe: How can I get an attribute of a DropDownList item using javascript? Pin
Martin_27-Jun-07 3:24
Martin_27-Jun-07 3:24 
GeneralRe: How can I get an attribute of a DropDownList item using javascript? Pin
kubben27-Jun-07 3:27
kubben27-Jun-07 3:27 
QuestionSending Data Pin
boyindie26-Jun-07 5:03
boyindie26-Jun-07 5:03 
AnswerRe: Sending Data Pin
Not Active26-Jun-07 5:09
mentorNot Active26-Jun-07 5:09 
AnswerRe: Sending Data Pin
Fred_Smith26-Jun-07 5:18
Fred_Smith26-Jun-07 5:18 
GeneralRe: Sending Data Pin
boyindie26-Jun-07 6:01
boyindie26-Jun-07 6:01 
GeneralRe: Sending Data Pin
Fred_Smith26-Jun-07 6:09
Fred_Smith26-Jun-07 6:09 
GeneralRe: Sending Data Pin
boyindie26-Jun-07 6:28
boyindie26-Jun-07 6:28 
GeneralRe: Sending Data Pin
Fred_Smith26-Jun-07 6:53
Fred_Smith26-Jun-07 6:53 
QuestionExport & Import Pin
Sinchan Nikam26-Jun-07 4:01
Sinchan Nikam26-Jun-07 4:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.