Calling a javascript function from server script URGENT HELP

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Calling a javascript function from server script URGENT HELP

    Ok I am about to pull my hair.
    I have an active x control in an object tag which, as you
    know cant have runat=server. So what I need is to not
    loose what is in this box everytime a postback happens. So
    all I want to do is add this statement
    document.all.txtEditor.value =
    document.all.Transcription.objEditor.textrtf;
    in the before the page is posted so that I can then
    retrive it and put it back.
    WHY CANT I DO THIS!!!!!!!!!!!!
    I have tried all kinds of things, the submit function is
    not getting called when the postback occurs.
    There has to be a way how to call a javascript function
    from the server side code. Where I can put this in the
    private void Page_Unload(object sender, System.EventArgs e)
    at least.
    HELP
    Silvia Brunet-Jones Guest

  2. Similar Questions and Discussions

    1. Calling Flash function from Javascript
      Hi everyone, I am desperately trying to call a Flash function (myfunction) from javascript... I believe the function has to be made accessible by...
    2. Calling a javascript function from flash
      Is it possible to call script functions from a flash object that the flash object will only be able to access once it is placed on an html page? ...
    3. calling a flash function from Javascript
      Hello everybody I want to call an ActionScript from the Website maybe using fscommand, but I don't know how to do it. Can anybody help me to...
    4. Calling client function from server script
      a.. How to write server script to call a client side function written in JavaScript? a.. When using Validation controls, it uses a file named...
    5. Calling Javascript function
      Hi all, Can i call my javascript functions from the web controls.Any appropriate site which will be tell more on this will be helpfull. ...
  3. #2

    Default Calling a javascript function from server script URGENT HELP

    Ok I am about to pull my hair.
    I have an active x control in an object tag which, as you
    know cant have runat=server. So what I need is to not
    loose what is in this box everytime a postback happens. So
    all I want to do is add this statement
    document.all.txtEditor.value =
    document.all.Transcription.objEditor.textrtf;
    in the before the page is posted so that I can then
    retrive it and put it back.
    WHY CANT I DO THIS!!!!!!!!!!!!
    I have tried all kinds of things, the submit function is
    not getting called when the postback occurs.
    There has to be a way how to call a javascript function
    from the server side code. Where I can put this in the
    private void Page_Unload(object sender, System.EventArgs e)
    at least.
    HELP
    ..


    Silvia Brunet Jones Guest

  4. #3

    Default Re: Calling a javascript function from server script URGENT HELP

    Actually, you CAN have a client-side <OBJECT> tag and a runat=server
    attribute. You just use an HTMLGenericControl in your CodeBehind to work
    with it.

    While you can't CALL a JavaScript function from the server side, you can
    certainly ADD one to the Page, using RegisterClientScriptBlock or
    RegisterStartupScript (if you want the script to run immediately after the
    page is loaded).

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of little things.

    "Silvia Brunet-Jones" <sbrunet_jones@hotmail.com> wrote in message
    news:35fb01c3554d$fcdc88e0$a001280a@phx.gbl...
    > Ok I am about to pull my hair.
    > I have an active x control in an object tag which, as you
    > know cant have runat=server. So what I need is to not
    > loose what is in this box everytime a postback happens. So
    > all I want to do is add this statement
    > document.all.txtEditor.value =
    > document.all.Transcription.objEditor.textrtf;
    > in the before the page is posted so that I can then
    > retrive it and put it back.
    > WHY CANT I DO THIS!!!!!!!!!!!!
    > I have tried all kinds of things, the submit function is
    > not getting called when the postback occurs.
    > There has to be a way how to call a javascript function
    > from the server side code. Where I can put this in the
    > private void Page_Unload(object sender, System.EventArgs e)
    > at least.
    > HELP

    Kevin Spencer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139