•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 427,493 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,471 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 4022 | Replies: 3
![]() |
•
•
Join Date: Aug 2006
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hello All,
I have developed a web application that has one form with several text boxes and 2 buttons submit and next.
On clicking the next button, the old values in the text box gets cleared and gives way to enter new values in the text box.
In the "next" button click event i am trying to append the old values of the text box to the new values so that i can have the string value finally when i am clcking on the "submit" Button.
The problem here is everytime i click on the next button, the string which i have declared is having only the last value and not the appended one..
Hope i am clear. Can anyone help me out with this.
Please note that i am new to this technology and hence help in simple words would be of great help to me
Neeraja
I have developed a web application that has one form with several text boxes and 2 buttons submit and next.
On clicking the next button, the old values in the text box gets cleared and gives way to enter new values in the text box.
In the "next" button click event i am trying to append the old values of the text box to the new values so that i can have the string value finally when i am clcking on the "submit" Button.
The problem here is everytime i click on the next button, the string which i have declared is having only the last value and not the appended one..
publicclass xxclass : System.Web.UI.Page { protected System.Web.UI.WebControls.Label Label1; protected System.Web.UI.WebControls.Label Label2; protected System.Web.UI.WebControls.Label Label3; . . public String s; privatevoid Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here } privatevoid ButtonSubmit_Click(object sender, System.EventArgs e) { //I want the value of s here } privatevoid ButtonNext_Click(object sender, System.EventArgs e) { Session["FName"] = TFName.Text; Session["LName"] = TLName.Text; s = s + "First Name :\n"; // The value of s is always the last value and is not appending. s = s + Session["FName"]; s = s + "Last Name : \n"; s = s + Session["LName"]; Session["mykey"] = s.ToString(); }
Hope i am clear. Can anyone help me out with this.
Please note that i am new to this technology and hence help in simple words would be of great help to me

Neeraja
Last edited by tgreer : Aug 17th, 2006 at 7:30 pm. Reason: added code tags
•
•
Join Date: Nov 2005
Location: Mountain View, CA
Posts: 47
Reputation:
Rep Power: 3
Solved Threads: 1
Hi Neeraja,
U need to retain the old value before updating the string 's'. Use the follwoing code.
Thanks,
Kedar.
U need to retain the old value before updating the string 's'. Use the follwoing code.
if(Session["mykey"] != null)
s = Session["mykey"] as string;
s = s + "First Name :\n"; // The value of s is always the last value and is not appending.
s = s + Session["FName"];
s = s + "Last Name : \n";
s = s + Session["LName"];
Session["mykey"] = s.ToString();Thanks,
Kedar.
•
•
•
•
Originally Posted by Neeraja
Hello All,
I have developed a web application that has one form with several text boxes and 2 buttons submit and next.
On clicking the next button, the old values in the text box gets cleared and gives way to enter new values in the text box.
In the "next" button click event i am trying to append the old values of the text box to the new values so that i can have the string value finally when i am clcking on the "submit" Button.
The problem here is everytime i click on the next button, the string which i have declared is having only the last value and not the appended one..
publicclass xxclass : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
.
.
public String s;
privatevoid Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
privatevoid ButtonSubmit_Click(object sender, System.EventArgs e)
{
//I want the value of s here
}
privatevoid ButtonNext_Click(object sender, System.EventArgs e)
{
Session["FName"] = TFName.Text;
Session["LName"] = TLName.Text;
s = s + "First Name :\n"; // The value of s is always the last value and is not appending.
s = s + Session["FName"];
s = s + "Last Name : \n";
s = s + Session["LName"];
Session["mykey"] = s.ToString();
}
Hope i am clear. Can anyone help me out with this.
Please note that i am new to this technology and hence help in simple words would be of great help to me
Neeraja
Last edited by tgreer : Aug 17th, 2006 at 7:31 pm. Reason: Added code tags.
Thanks,
KedarNath Challa
KedarNath Challa
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net .net framework 3.0 access ajax asp business code combo custom cyber-squatting data developer development dom domains dropdownlist feed microsoft module msdn net office pay-per-click reader reuse security skin software sql strider theme trademark typo-squatting vista weather web windows workflow xml xoap
- Button click event only working the second time (C#)
- Calling button-click events from different classes (Python)
- Click event >> window appears? (Python)
- Problem in displaying returned value from function (C#)
- Control button Click event (Visual Basic 4 / 5 / 6)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: checkbox as a itemtemplate in a datalist
- Next Thread: need some help with url qeury string with response.redirect



Linear Mode