I want to be able to send a variable from the sub procedure and send it to the html code for processing. Is it possible?
Printable View
I want to be able to send a variable from the sub procedure and send it to the html code for processing. Is it possible?
You mean to JAVASCRIPT... not the HTML.
Is it a global javascript variable or limited to a function? You can use Page.RegisterClientScriptBlock/RegisterStartupScript.
The variable will be going the param tag between the object tag of the html page.
I see.
In that case, what you want to do is to make the object tag runat=server. Then, access the INNERHTML property of the object, and add your value there (it's a string property so just add the tag)
A better way would be to use a literal control and to write all the object tags, etc to the literal control.
The easiest way to get a codebehind variable into a Javascript variable that I've found is to declare the variable as Protected:
...and then use ASP tags in the Javascript:Code:Protected MyStringVariable as String
Code:var MyJavascriptVariable = '<%= MyStringVariable %>';
He isn't talking about javascript. He's talking about param tags.