Click here to Skip to main content
15,171,439 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

I have 2 webpages Pages A,B.

In Page A,I got a linkbutton which redirects to pageB.

I will fill a textbox in page B and clicks submit button.,then again it should redirect to PageA with text(text entered in textbox and placed in session from pageB) and should display in dynamic label of page A (label is available in panel of PageA).

this process is cyclic and each time i enter a text from page B,it should create a new label in page A,without removing old label.

My Issue is when I write a new text in page B,its removing old comment and replacing with a new one.and that too label availabe is a static one(I dragged from toolbox).

So I got a solution for this (ie)to place datalist,below is the code for it:


save comments click event:


Session["Output"] = lDialogcomment.Text + "                                          " + lsUserName.Text + "                                        " + time;

List<string> values = new List<string>();

if (Session["Output"] != null)

values = Session["Output"] as List<string>;

Response.Redirect("Page A.aspx");


public void BindData()


dlValues.DataSource = Output;



public List<string> Output




    List<string> values = new List<string>();

           if (Session["Output"] == null)


Session["Output"] = new List<string>();


          return Session["Output"] as List<string>;





"Output"] = value;



Page-load event:



Datalist Control Design Source

<asp:DataList ID="dlValues" runat="server" RepeatDirection="Vertical">


asp:Label Text="<%# Container.DataItem %>" ID="lblValue" runat="server"></asp:Label>



no build errors,no runtime errors and also no desired output.

Please help me in this ASAP,as it it very critical situation for me.
[no name] 26-Mar-14 19:56pm
"lDialogcomment.Text=textbox1.text;", it's replacing the comment text because that is exactly what you are telling it to do.

1 solution

The best way is make temp table in database and each time save and fetch data from there because in session save large amount of value will take more load on server.

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