| | |
Problem with javascript variable and hidden input
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2006
Posts: 45
Reputation:
Solved Threads: 3
Hi, all!
I've been trying to pass a javascript variable to an asp.net webapp through a hidden input field.
All according to post http://www.daniweb.com/techtalkforums/thread26184.html.
But something seems to be garbled.
Here's what parts of my aspx code looks like.
Somehow the line
I've tried with
The javascript code is in a window.onload function.
What I want to do is to have the content of the hidden field mailed as html from CodeBehind.
Any suggestions?
I've been trying to pass a javascript variable to an asp.net webapp through a hidden input field.
All according to post http://www.daniweb.com/techtalkforums/thread26184.html.
But something seems to be garbled.
Here's what parts of my aspx code looks like.
... var src = document.documentElement.outerHTML; document.getElementById("pSource").Value = src; } </script> </head> <body> <form runat="server"> <input id="pSource" type="hidden" /> ...
document.getElementById("pSource").Value = src; doesn't work.I've tried with
<input id="pSource" type="hidden" runat="server" /> as well.The javascript code is in a window.onload function.
What I want to do is to have the content of the hidden field mailed as html from CodeBehind.
Any suggestions?
•
•
Join Date: Jun 2006
Posts: 45
Reputation:
Solved Threads: 3
I solved it myself by expanding the coding Sathiya used in this thread: http://www.daniweb.com/techtalkforum...ad.php?t=45854
My solution was to use the RenderControl method in the Page class.
This gives me the entire entity of the rendered page as a string, which can then be used as body in a html-mail.
And this can be done without any hidden variables and javascript code.
My solution was to use the RenderControl method in the Page class.
This gives me the entire entity of the rendered page as a string, which can then be used as body in a html-mail.
And this can be done without any hidden variables and javascript code.
![]() |
Similar Threads
- how can i pass a value from java script to JSP scriplet (JSP)
- Pass Javascript variable to PHP code (PHP)
- retrieving a single cell of data from a MySQL database (PHP)
- javascript variable in jsp session (JSP)
- How to store javascript variable in jsp session (JSP)
- Tab control on hidden input fields (HTML and CSS)
Other Threads in the ASP.NET Forum
- Previous Thread: IFrame
- Next Thread: Email Web Page Content
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax appliances application asp asp.net beginner box browser businesslogiclayer button c# c#gridviewcolumn cac checkbox child class compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datalist deadlock deployment development dgv dialog dropdownmenu dynamic dynamically edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form forms grid gridview gudi homeedition hosting iis image javascript jquery list menu mssql multistepregistration nameisnotdeclared novell objects opera order problem ratings redirect registration relationaldatabases rotatepage search security select serializesmo.table sessionvariables silverlight smoobjects sql ssl tracking treeview typeof validatedate validation vb.net virtualdirectory vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment wizard xml xsl





