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. Advertisements

  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. Advertisements

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:
    828
    Alphonse Giambrone
    Jun 28, 2003
  2. ntm
    Replies:
    2
    Views:
    4,896
    Teemu Keiski
    Jan 19, 2004
  3. CW
    Replies:
    3
    Views:
    6,482
    John Sivilla
    May 2, 2004
  4. Paolo Pignatelli
    Replies:
    6
    Views:
    2,499
    Paolo Pignatelli
    Feb 21, 2005
  5. aaa
    Replies:
    3
    Views:
    4,965
    Verde
    May 6, 2005
  6. Replies:
    2
    Views:
    13,615
    Raymond
    Apr 6, 2006
  7. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    722
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  8. Generating HTML code in the code-behind

    , Aug 25, 2005, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    271
    jjrdk
    Sep 25, 2005
Loading...