473,480 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Read html contents

I have a page that calculates a large formula in javascript and I display
the results in a td.innerHTML. We now want save that value in a db, but
since its not a label how can I access that value in codebehind?

Thanks in advance,
MarkD
Nov 19 '05 #1
7 973
on submit copy td.innerHtml into a hidden form field and use Request.Form.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"MarkD" <mr*@ATeam.net> wrote in message
news:eR**************@TK2MSFTNGP14.phx.gbl...
I have a page that calculates a large formula in javascript and I display
the results in a td.innerHTML. We now want save that value in a db, but
since its not a label how can I access that value in codebehind?

Thanks in advance,
MarkD

Nov 19 '05 #2
How about td.InnerHTML?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"MarkD" <mr*@ATeam.net> wrote in message
news:eR**************@TK2MSFTNGP14.phx.gbl...
I have a page that calculates a large formula in javascript and I display
the results in a td.innerHTML. We now want save that value in a db, but
since its not a label how can I access that value in codebehind?

Thanks in advance,
MarkD

Nov 19 '05 #3
You need to set the td tag to runat=server and give the td element an id.
You can then access the innerHtml of the td element as follows:

protected System.Web.UI.HtmlControl.HtmlTableCell td1;

<--Your data connection and stored proceedures omitted -->
string whatever=td1.innerHtml;

you can stuff a data parameter with that string whatever.

I hope that helps

Sam-

"MarkD" <mr*@ATeam.net> wrote in message
news:eR**************@TK2MSFTNGP14.phx.gbl...
I have a page that calculates a large formula in javascript and I display
the results in a td.innerHTML. We now want save that value in a db, but
since its not a label how can I access that value in codebehind?

Thanks in advance,
MarkD

Nov 19 '05 #4
I think this method gets me on the right track, but the client side data
result is not available. It just returns empty string. The runat=server
allows me access to the td, but the server side doesn't know about the
containg data because of the javascript.
"Sam Samnah" <we**********@terraquest123.ca> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
You need to set the td tag to runat=server and give the td element an id.
You can then access the innerHtml of the td element as follows:

protected System.Web.UI.HtmlControl.HtmlTableCell td1;

<--Your data connection and stored proceedures omitted -->
string whatever=td1.innerHtml;

you can stuff a data parameter with that string whatever.

I hope that helps

Sam-

"MarkD" <mr*@ATeam.net> wrote in message
news:eR**************@TK2MSFTNGP14.phx.gbl...
I have a page that calculates a large formula in javascript and I display
the results in a td.innerHTML. We now want save that value in a db, but
since its not a label how can I access that value in codebehind?

Thanks in advance,
MarkD


Nov 19 '05 #5
Maybe try stuffing the td element and a string in your codebehind
syncronously then.

"MarkD" <mr*@ATeam.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I think this method gets me on the right track, but the client side data
result is not available. It just returns empty string. The runat=server
allows me access to the td, but the server side doesn't know about the
containg data because of the javascript.
"Sam Samnah" <we**********@terraquest123.ca> wrote in message
news:O9**************@TK2MSFTNGP10.phx.gbl...
You need to set the td tag to runat=server and give the td element an id.
You can then access the innerHtml of the td element as follows:

protected System.Web.UI.HtmlControl.HtmlTableCell td1;

<--Your data connection and stored proceedures omitted -->
string whatever=td1.innerHtml;

you can stuff a data parameter with that string whatever.

I hope that helps

Sam-

"MarkD" <mr*@ATeam.net> wrote in message
news:eR**************@TK2MSFTNGP14.phx.gbl...
>I have a page that calculates a large formula in javascript and I
>display
> the results in a td.innerHTML. We now want save that value in a db, but
> since its not a label how can I access that value in codebehind?
>
> Thanks in advance,
> MarkD
>
>



Nov 19 '05 #6
snt
Instead of the td, why don't you use a regular txt box with the
following style and readonly="true"?

style="BORDER:none;BACKGROUND-COLOR:Transparent"

Hope this helps.

Nov 19 '05 #7
I actually did something very similar. I left the td alone because I have
exensive sytles applied to it, but I just added an asp:textbox with 0 width
and when I write the value to the td, I also write
document.getElementbyID('txtResult').value = result. I kinda figured I could
do this the whole time, but I was just hoping to keep a minimal amount
server controls on the page.

Thanks to all,
MarkD


"snt" <sn******@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Instead of the td, why don't you use a regular txt box with the
following style and readonly="true"?

style="BORDER:none;BACKGROUND-COLOR:Transparent"

Hope this helps.

Nov 19 '05 #8

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

Similar topics

1
8969
by: David Thomas | last post by:
Hi there, a while ago, I posted a question regarding reading japanese text from a text file. Well, since I solved the problem, I thought I'd post my solution for the benefit of other people with...
6
1596
by: Christina | last post by:
I want to read a classic HTML Form using the ASP Request object on the server. This is a common approach. But how can I read all the contents of a listbox (the <select> tag)? Best regards,...
2
2106
by: LaBird | last post by:
Dear all, I'd like to know if there is any function or program call in C++ (without memory protection support by OS), that can determine whether an object is being read or written? e.g., a =...
2
1362
by: Paul Hale | last post by:
Hi, I have two web forms (lets call them webform1 and webform2) that run as part of the same web application. Webform1 contains a text box. I would like to pop up a new browser window...
5
5918
by: VB Programmer | last post by:
I have an HTML file that I want to read on the fly and insert the contents into a string (for the body of an email.) How can I do this?
2
5227
by: Jim S | last post by:
I have a need to read the contents of an html table on a remote web page into a variable. I guess this is called screen scraping but not sure. I'm not sure where to start or what the best...
4
4181
by: Kuldeep | last post by:
Hi All, I am trying to read the contents of a page through its URL. My code snippet is as follows: public void mtdGetPageDataHWR() { HttpWebRequest objRequ =...
2
17496
by: Pugi! | last post by:
Using AJAX I want to send some information from the server (php-page) as XML to the client. The contents can be very divers so I have to use XML instead of text. On one occasion the contents is...
9
4256
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. Is it programatically possible in VB.NET to read the contents of web.config's <customErrorselement? I looked at using ConfigurationSettings.AppSettings, but that doesn't work. I need to...
2
1229
by: syam | last post by:
Hai evenerybody.. I uploaded a text/html file into the database now i want to read the contents of the file and write the contents to send as an email. How do i read the contents of the file,...
0
7041
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
6908
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...
1
6739
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
6929
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...
0
5337
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.