Click to See Complete Forum and Search --> : Code Behind -> Javascript


lloydsj
04-16-2003, 03:55 AM
Hi,

Basically, I am trying to pass some information from my database (which I am accessing in my code behind) to a Iframe Edit Control in my HTML and Javascript code. How do I pass information between these?

I know how to access the database no problem in the code behind, and how to put information into the Iframe Edit Control in my Javascript... but i dont know how to pass info between them. I presume its through a global variable or something?...

<Script Language="javascript" for="DesktopText" event="onload">
DesktopText.document.body.innerHTML = ''
</Script>

...with putting my global variable (which i would fill from the database in my code behind) at the end of that line.

CAN ANYONE HELP?

I am using Visual Studio.net and im working in an .aspx.

Cheers,
Stu.

lloydsj
04-22-2003, 04:21 AM
Cheers,

I have now actually got it kind of working for passing the data in... what i did was declare a public variable in my code behind, then filled it with the data, and then placed it in the IFRAME using <%= VARIABLENAME %> in HTML/JAVASCRIPT view.

However, I dont know how to get it back out again... ie. I dont know how to refer to the IFRAME from the code behind?

or alternatively I dont know how to fill a variable from the HTML/Javascript that can then be used in the code behind to populate the database.

If it is not clear what i mean... basically I have now got my info in the IFRAME on screen and I want to save the contents to a database (the code for this is in my code behind).

Any ideas how to do this?

Stu.

tim_gor
04-22-2003, 04:40 AM
Just a suggestion and this may be (and probably is!) irrelevant...

How about using a <div id="PredefinedDIVName">DATA HTML(maybe even commented out using <!-- -->) </div>

Then you can just access the data using PredefinedDIVName.innerHTML

Don't know if this will work as your problem seems quite complex