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

Discussion in 'ASP .Net Web Controls' started by Eddie B., Jan 9, 2004.

  1. Eddie B.

    Eddie B. Guest

    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.
     
    Eddie B., Jan 9, 2004
    #1
    1. Advertising

  2. 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
    "Eddie B." <> wrote in message
    news:...
    > 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.
    >
    >
    >
    >
    >
    >
    >
     
    Victor Garcia Aprea [MVP], Jan 10, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    620
    Alphonse Giambrone
    Jun 28, 2003
  2. CW
    Replies:
    3
    Views:
    6,186
    John Sivilla
    May 2, 2004
  3. aaa
    Replies:
    3
    Views:
    4,800
    Verde
    May 6, 2005
  4. Daniel Manes

    Code-Behind Pain in the Behind!

    Daniel Manes, Jun 10, 2005, in forum: ASP .Net
    Replies:
    11
    Views:
    686
  5. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    509
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
Loading...

Share This Page