473,395 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to put an asp.net table's content into a session object?

Hi all,

I have a asp.net table control placed on 'Calculator.aspx' page. The table
looks like this:

<div class="roiHTML" id="highAbandonRateSale" runat="server" visible="false"

<asp:Table runat="server" ID="HARS_Table" >

<asp:TableRow><asp:TableCell><p>Average weekly Inbound calls offered
=</p></asp:TableCell><asp:TableCell>{INBOUND}</asp:TableCell></asp:TableRow>

<asp:TableRow><asp:TableCell><p>Average weekly abandon rate (%) =</p></asp:
TableCell><asp:TableCell>{ABANDON}</asp:TableCell></asp:TableRow>

</asp:Table>
</div>

In the 'Calculator.aspx.cs' code behind file I am trying to place the content
of the above table into a session object.
At the point I'm trying to do this the table has been created but is just
hidden from site. So I'm thinking something along the lines of:

Session["Session1"] = HARS_Table;
OR
Session["Session1"] = HARS_Table.InnerText;

I am way off in solving this simple task. Can someone please help me?
Thanks in advance.

--
Message posted via http://www.dotnetmonster.com
Jun 15 '06 #1
1 1525

Hi,

To store the Content of table in session, you can do as below

To store the data of FirstRow alone
Session["Session1"]=Table1.Rows[0].Cells[0].Text;

To Store the entire table content , you need store that in single variable
string x="";
for(int i=0;i<Table1.Rows.Count;i++)
{
x+=Table1.Rows[i].Cells[0].Text ;
}
Session["Session1"]=x;

Thanx
Sharmila

"Jon via DotNetMonster.com" <u2272@uwe> wrote in message
news:61cd25635931b@uwe...
Hi all,

I have a asp.net table control placed on 'Calculator.aspx' page. The
table
looks like this:

<div class="roiHTML" id="highAbandonRateSale" runat="server"
visible="false"

<asp:Table runat="server" ID="HARS_Table" >

<asp:TableRow><asp:TableCell><p>Average weekly Inbound calls offered
=</p></asp:TableCell><asp:TableCell>{INBOUND}</asp:TableCell></asp:TableRow>

<asp:TableRow><asp:TableCell><p>Average weekly abandon rate (%)
=</p></asp:
TableCell><asp:TableCell>{ABANDON}</asp:TableCell></asp:TableRow>

</asp:Table>
</div>

In the 'Calculator.aspx.cs' code behind file I am trying to place the
content
of the above table into a session object.
At the point I'm trying to do this the table has been created but is just
hidden from site. So I'm thinking something along the lines of:

Session["Session1"] = HARS_Table;
OR
Session["Session1"] = HARS_Table.InnerText;

I am way off in solving this simple task. Can someone please help me?
Thanks in advance.

--
Message posted via http://www.dotnetmonster.com

Jun 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rootshell | last post by:
I need to create the table and I want to edit its content from www level. Here is some example: http://www.rootshell.be/~flash44 There is a table. Is there possibilty to edit the content...
0
by: Luis Esteban Valencia | last post by:
Hello I wrote a program with code behind in C# to add row into table dynamically and the program worked very well in .Net Framework 1.1. When I run this program in .Net Framework 2.0 beta...
1
by: kingster | last post by:
Hi, I have a regular dataset and all i want to do is make a pivot table display in a browser with the datasource of the pivot table to be this dataset and then the end-user will be able to do...
6
by: TB | last post by:
Hi All: Here´s a very simple question: I have created a datatable inside a dataset, and subsequently selected a particular row using certain criteria. How do get the index number of that...
2
by: Terry On Windigo | last post by:
I must have forgotten someting. I did something like this about 4 years ago and got it to work. Now I need to do it again and I get this error message: Technical Information (for support...
1
by: MissMarie | last post by:
I've been playing around with DIV tables in myspace to better learn how to rewrite my own code for my business site without having to pay someone to design it. I've tried embedding a slideshow into...
6
by: Jeff | last post by:
....still new to visual studio 2005 and vb.net I have a master page with a content placeholder. The content page has a table in the content placeholder (placed there via dragging from the...
7
oll3i
by: oll3i | last post by:
i want to change the values in two columns one colum is a combobox and the secons column is editable too i want to get the value of that second column and the value of combobox and sent that...
21
tsubasa
by: tsubasa | last post by:
I am working on a wish list where users add products to their list for future purhcases. I am using a GridView to display the records by users after they have login to the shopping cart. How can I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.