Calling functions?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Charles A. Lackman

    #1

    Calling functions?

    Hello, I wrote a jscript function within the HTML window of my webpage and
    would like to call it from inside the ASPX code-behind page. Any
    suggestions?

    or

    I would like to cause an alert box to pop up using the code-behind window of
    an ASPX page.

    Any of these two things will work for me.


    Thanks
    Chuck


  • Graham

    #2
    Re: Calling functions?

    Hey Chuck,

    What you are trying to do doesn't really make any sense :) Code behind
    executes on the server, jscript runs on the client. The two don't have
    anything to do with each other. Your only hope might be to have code behind
    make the browser call your jscript function to open up the alert box by
    putting a call to the jscript function in some client-side event like
    <body onload=myFuncti on();>

    Otherwise, server-side code cannot effectively call client-side script but
    it can cause it to be called. (if that makes sense).

    Good luck,
    Graham.

    "Charles A. Lackman" <Charles@cet.co m> wrote in message
    news:u1j1SKaQDH A.1712@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Hello, I wrote a jscript function within the HTML window of my webpage and
    > would like to call it from inside the ASPX code-behind page. Any
    > suggestions?
    >
    > or
    >
    > I would like to cause an alert box to pop up using the code-behind window[/color]
    of[color=blue]
    > an ASPX page.
    >
    > Any of these two things will work for me.
    >
    >
    > Thanks
    > Chuck
    >
    >[/color]


    Comment

    • Sabre

      #3
      Re: Calling functions?

      Hello Chuck

      What about ...
      Response.Write( "<script language='javas cript'>window.a lert('Thankyou for
      your message! We will email you shortly.');</script>")

      Hope this helps.

      Graeme

      "Charles A. Lackman" <Charles@cet.co m> wrote in message
      news:u1j1SKaQDH A.1712@TK2MSFTN GP12.phx.gbl...[color=blue]
      > Hello, I wrote a jscript function within the HTML window of my webpage and
      > would like to call it from inside the ASPX code-behind page. Any
      > suggestions?
      >
      > or
      >
      > I would like to cause an alert box to pop up using the code-behind window[/color]
      of[color=blue]
      > an ASPX page.
      >
      > Any of these two things will work for me.
      >
      >
      > Thanks
      > Chuck
      >
      >[/color]


      Comment

      • jayuya

        #4
        Calling functions?

        Chuck,

        Look into Page.RegisterSt artupScript...

        This will do all that you need...

        jayuya
        [color=blue]
        >-----Original Message-----
        >Hello, I wrote a jscript function within the HTML window[/color]
        of my webpage and[color=blue]
        >would like to call it from inside the ASPX code-behind[/color]
        page. Any[color=blue]
        >suggestions?
        >
        > or
        >
        >I would like to cause an alert box to pop up using the[/color]
        code-behind window of[color=blue]
        >an ASPX page.
        >
        >Any of these two things will work for me.
        >
        >
        >Thanks
        >Chuck
        >
        >
        >.
        >[/color]

        Comment

        Working...