lloydsj Posted April 16, 2003 Posted April 16, 2003 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. Quote
Moderators Robby Posted April 16, 2003 Moderators Posted April 16, 2003 Do you want to put the data into a Grid or html table? Quote Visit...Bassic Software
lloydsj Posted April 17, 2003 Author Posted April 17, 2003 HTML Table! A html table! ... i am making a WYSIWYG HTML editor thingy. I have got actually now 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 place it in the table using <%= VARIABLENAME %> in HTML/JAVASCRIPT view. However, what I am now really stuck with .. is how to get the contents back out again and into a variable that I can once again use in the code behind so that i can save the new contents. obviously doing something like... <%= VARIABLENAME %> = 'my new content' ... is not going to work. Any ideas???? Quote
lloydsj Posted April 22, 2003 Author Posted April 22, 2003 Any ideas? I have just read what i put and its not that clear... I have now actually got it kind of working for passing the data in (from the database)... what i did was declare a public variable in my code behind, then filled it with the data (from the database), and then placed this content 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 content in the IFRAME on screen and I want to save the contents to a database (the code for doing this is in my code behind). Any ideas how to do this? Stu. Quote
*Gurus* Derek Stone Posted April 22, 2003 *Gurus* Posted April 22, 2003 You'll need to submit the value to the server via a form field or a query string value. Quote Posting Guidelines
lloydsj Posted April 22, 2003 Author Posted April 22, 2003 Ok cheers, If you have got any examples of how to do this... or which of the 2 would be better/easier... it would be great. Cheers, Stu Quote
Moderators Robby Posted April 22, 2003 Moderators Posted April 22, 2003 An example of QueryString is http://www.xtremedotnettalk.com/showthread.php?threadid=71514 The first part (until the ? mark) is the page you want to access the rest is the values being passed along. So in your aspx page or in the code-behind you would do something like this... dim s as string = Request.QueryString("threadid") ' s will equal '71514' Quote Visit...Bassic Software
lloydsj Posted April 25, 2003 Author Posted April 25, 2003 Form Field Ok, I have had a look at QueryString and Form Field. Form Field will be a much better option for my problem. However, assuming that I have got my data in a hidden form field, how do I access this information from my Visual Basic Code Behind in ASP.NET? as that is where the code is to stick the passed information in the database. Is it to do with posting the form to itself? or how? whats the easiest/best method? Cheers, Stu. Quote
Moderators Robby Posted April 25, 2003 Moderators Posted April 25, 2003 you can use Request.Form.GetValues() , Request.Form.Item() and a few more. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.