HOW TO get innerText from IFrame in C# (server-side)?

S

SMichal

Hi, is there some posibility how to read inner text from IFRAME on
server-side ?
I've tested it with innerText and InnerHtml but it doesnt work
 
A

Andy Klare

I don't believe there is a server object tied to an IFrame. Not sure if you
would be able to add an id and runat=server attribute to the IFrame to allow
you to access it on the server but it might me possible. Not sure what
control you would need to associate it with in the server code.

If JavasScript is an option then this should work:
Right before you submit the form, use JavaScript to put the innerHTML into
another server control that is accessible on the server such as a textbox or
maybe a Placeholder or Panel. An standard input type="hidden" control with
Runat=server control with matching server code control declaration
HtmlControls.HtmlInputHidden txtTB; should allow you to access the
transfered innetHTML from the hidden textbox on the server.

Hope this helps!
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top