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

Hi Neeraja,

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.

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

Please use the code tags when posting code. Thank you.

can somebody help me???
I want to auto post the page through my python code
I want to read the page then enter values in text boxes & then submitting it. All thr python code
Is it possible through python
python is new for me

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.