client side script with RegisterStartupScript issue

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

  1. #1

    Default Re: client side script with RegisterStartupScript issue

    no, you can not control the order the blocks are rendered. you can concat
    the scripts and register them once. also
    if you are doing code like:

    <script> window.open([url]http://myurl);[/url] </script>

    to open the window on postback, you should reengineer unless its an entranet
    site. popup ad blockers, an i hope IE soon (Netscape, Opera, etc already
    do), block the execution of this code. window.open should only be legal from
    a client click event.

    -- bruce (sqlwork.com)



    ..




    "Dave Stienessen" <daves@xata.com> wrote in message
    news:eM44KB5VDHA.384@TK2MSFTNGP12.phx.gbl...
    > I have some web pages that will issue script to spawn a url in another
    > window after the page posts back and sets focus to the new window - the
    same
    > pages contain web user controls that put in script in the page that sets
    > focus to a control on the form -
    >
    > The problem I run into is the script that launches the new browser gets
    put
    > into the html 1st and the script for setting focus in the use control gets
    > run 2nd - the behavior because of this is that my new window gets
    launched,
    > gets focus, then the script that sets focus in the old window runs and
    > returns focus to the original window (apparently setting focus to a
    control
    > grabs focus for the entire window)
    >
    > It seems like a good enhancement to RegisterStartupScript would be a
    > relative order of the script so I could force my "new Window" script to
    run
    > last - Is there any way that I can control the ordering of how ASP.NET
    > renders these?
    >
    > TIA
    > Dave
    >
    >

    bruce barker Guest

  2. Similar Questions and Discussions

    1. Client side script ASP.NET
      Hi, How can i eassely add client side script in my code. I have a sort of TAB control, that works through postbacks but i want the action taken...
    2. How to identify client in the server-side script?
      Imagine application consisting from server-side script and many client-side flash applications. Clients are connecting to server and calling various...
    3. Client Side Script interferes with Server Side Script?
      I added the form validation script (Java Script) to the head section of my insert records form page which works great when tested but when I submit...
    4. Client Side Java Script
      Hi, am not a ASP.NET programmer, and it seems that i have to learn web development, so i need help learning java script. any links to some...
    5. Newbie client side JavaScript debugging issue
      Hello. I apologise for the potential stupidity of this question in advance. After doing a lot of server side ASP.NET coding and debugging, I've...
  3. #2

    Default Re: client side script with RegisterStartupScript issue

    I was afraid of that... Thanks for the input - our script code does take
    into account popup blockers - if the window fails to open in script, it
    redirects to the page within the same window -
    Thanks again...

    "bruce barker" <nospam_brubar@safeco.com> wrote in message
    news:ufo4U55VDHA.1896@TK2MSFTNGP12.phx.gbl...
    > no, you can not control the order the blocks are rendered. you can concat
    > the scripts and register them once. also
    > if you are doing code like:
    >
    > <script> window.open([url]http://myurl);[/url] </script>
    >
    > to open the window on postback, you should reengineer unless its an
    entranet
    > site. popup ad blockers, an i hope IE soon (Netscape, Opera, etc already
    > do), block the execution of this code. window.open should only be legal
    from
    > a client click event.
    >
    > -- bruce (sqlwork.com)
    >
    >
    >
    > .
    >
    >
    >
    >
    > "Dave Stienessen" <daves@xata.com> wrote in message
    > news:eM44KB5VDHA.384@TK2MSFTNGP12.phx.gbl...
    > > I have some web pages that will issue script to spawn a url in another
    > > window after the page posts back and sets focus to the new window - the
    > same
    > > pages contain web user controls that put in script in the page that sets
    > > focus to a control on the form -
    > >
    > > The problem I run into is the script that launches the new browser gets
    > put
    > > into the html 1st and the script for setting focus in the use control
    gets
    > > run 2nd - the behavior because of this is that my new window gets
    > launched,
    > > gets focus, then the script that sets focus in the old window runs and
    > > returns focus to the original window (apparently setting focus to a
    > control
    > > grabs focus for the entire window)
    > >
    > > It seems like a good enhancement to RegisterStartupScript would be a
    > > relative order of the script so I could force my "new Window" script to
    > run
    > > last - Is there any way that I can control the ordering of how ASP.NET
    > > renders these?
    > >
    > > TIA
    > > Dave
    > >
    > >
    >
    >

    Dave Stienessen 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