How to address functions on HTML page from code behind page?

E

Eddie B.

Is there a way to address functions that are inside of a script tag on the
HTML(.aspx) page from the code behind (.aspx.cs) page?

I want to be able to place a function inside of script tags on the .aspx
page such as this
<SCRIPT language="JScript">
function openDetails() {
window.open("http://localhost/details.aspx","_blank",
"fullscreen=yes, toolbar=no, menu=no");
}
</SCRIPT>

and I want to be able to
private void Page_Load(object sender, System.EventArgs e)

{

openDetails();

}



Why? Because I want to run my web app in kiosk mode and I don't know if
there is a way to set the full screen and no toolbar and no menu properties
from the code behind page.
 
V

Victor Garcia Aprea [MVP]

Hi Eddie,

You can't call a javascript client-side method from a server-side method.
What you can do is to output the proper client-side code to call your
client-side function from server-side so when the page is rendered down to
the client your function will end up called. Take a look at the
Page.Regiser* methods to deal with client-side scripts from your server-side
code.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx

To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top