javascript function not executing...

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

  1. #1

    Default javascript function not executing...

    Are you getting confused between client and server?

    Should it be:
    >
    >Source Error:
    >
    >Line 39:
    >Line 40: <DIV ID=divOverview
    >Line 41: STYLE=CustomHeightedStyle()
    >Line 42: align=center ms_positioning="FlowLayout">
    >Line 43:
    >
    HTH,
    Gaz
    >-----Original Message-----
    >I'm trying to set the height of a DIV through the style,
    by using the frame
    >(orderscontrol) height and subtracting a buffer space
    used for some buttons
    >but the function in the script tags doesn't even run. I
    get the error...
    >
    >##################
    >#
    >#
    >
    >Compilation Error
    >Description: An error occurred during the compilation of
    a resource required
    >to service this request. Please review the following
    specific error details
    >and modify your source code appropriately.
    >
    >Compiler Error Message: BC30451:
    Name 'CustomHeightedStyle' is not declared.
    >
    >Source Error:
    >
    >Line 39:
    >Line 40: <DIV ID=divOverview
    >Line 41: STYLE='<%=CustomHeightedStyle()%>'
    >Line 42: align=center ms_positioning="FlowLayout">
    >Line 43:
    >
    >#
    >#
    >#####################
    >
    >
    >
    >and here's the HTML from the aspx page.
    >
    >
    >
    >###############################
    >#
    >#
    >
    ><body MS_POSITIONING="GridLayout">
    >
    ><SCRIPT LANGUAGE=javascript>
    >
    > function CustomHeightedStyle()
    > {
    > var frmHeight = parent.orderscontrol.height
    > var divHeight = frmHeight - 63
    > var divStyle = "Z-INDEX: 102; " +
    > "LEFT: 0px; " +
    > "OVERFLOW: auto; " +
    > "WIDTH: 100%; " +
    > "POSITION: absolute; " +
    > "TOP: 61px; HEIGHT: " +
    > frmHeight.toString() + "px"
    > return divStyle
    > }
    >
    ></SCRIPT>
    >
    ><form id=controls method=post runat="server">
    >
    ><DIV ID=divOverview
    >STYLE='<%=CustomHeightedStyle()%>'
    >align=center ms_positioning="FlowLayout">
    >
    >....some stuff...
    >
    ></DIV></FORM></BODY>
    >
    ></HTML>
    >
    >#
    >#
    >###############################
    >
    >I've tried usnig the "javascript:" prefix in the element
    tag, but then the
    >error reads that 'javascript' is undefined.
    >your help is appreciated, thanks
    >Dan.
    >
    >
    >.
    >
    Gary Varga Guest

  2. Similar Questions and Discussions

    1. Executing JavaScript in a PDF using .Net
      I have a VB6 "report manager" application, and some of the reports are written into Adobe Acrobat documents. Basically, these documents all have a...
    2. javascript split function
      I'm using the split method to put values into an array. When I pass in the argument to the function and then use the split method, the delimiters...
    3. Javascript function in Flash
      Hello, i have a flash menu, but i want to open a javascript popup. How can i use this function that i'll use for TML in flash? <SCRIPT...
    4. executing a shell command within a function
      Hi, I’m coding a function that will create a set of directories using execution of shell commands within the function. Then the function saves...
    5. Javascript print function
      Hi Is there a javascript print function that will work on a mac??I have put one on my page and it works fine on pc but when on mac the link does...
  3. #2

    Default Re: javascript function not executing...

    doesn't it have to be client side since i want to get the containment
    frame's height, then apply that to a DIV attribute?

    "Gary Varga" <MSNG@VargaLtd.freeserve.co.uk> wrote in message
    news:0c2301c34d1f$5963e630$a401280a@phx.gbl...
    > Are you getting confused between client and server?
    >
    > Should it be:
    >
    > >
    > >Source Error:
    > >
    > >Line 39:
    > >Line 40: <DIV ID=divOverview
    > >Line 41: STYLE=CustomHeightedStyle()
    > >Line 42: align=center ms_positioning="FlowLayout">
    > >Line 43:
    > >
    >
    > HTH,
    > Gaz
    >
    > >-----Original Message-----
    > >I'm trying to set the height of a DIV through the style,
    > by using the frame
    > >(orderscontrol) height and subtracting a buffer space
    > used for some buttons
    > >but the function in the script tags doesn't even run. I
    > get the error...
    > >
    > >##################
    > >#
    > >#
    > >
    > >Compilation Error
    > >Description: An error occurred during the compilation of
    > a resource required
    > >to service this request. Please review the following
    > specific error details
    > >and modify your source code appropriately.
    > >
    > >Compiler Error Message: BC30451:
    > Name 'CustomHeightedStyle' is not declared.
    > >
    > >Source Error:
    > >
    > >Line 39:
    > >Line 40: <DIV ID=divOverview
    > >Line 41: STYLE='<%=CustomHeightedStyle()%>'
    > >Line 42: align=center ms_positioning="FlowLayout">
    > >Line 43:
    > >
    > >#
    > >#
    > >#####################
    > >
    > >
    > >
    > >and here's the HTML from the aspx page.
    > >
    > >
    > >
    > >###############################
    > >#
    > >#
    > >
    > ><body MS_POSITIONING="GridLayout">
    > >
    > ><SCRIPT LANGUAGE=javascript>
    > >
    > > function CustomHeightedStyle()
    > > {
    > > var frmHeight = parent.orderscontrol.height
    > > var divHeight = frmHeight - 63
    > > var divStyle = "Z-INDEX: 102; " +
    > > "LEFT: 0px; " +
    > > "OVERFLOW: auto; " +
    > > "WIDTH: 100%; " +
    > > "POSITION: absolute; " +
    > > "TOP: 61px; HEIGHT: " +
    > > frmHeight.toString() + "px"
    > > return divStyle
    > > }
    > >
    > ></SCRIPT>
    > >
    > ><form id=controls method=post runat="server">
    > >
    > ><DIV ID=divOverview
    > >STYLE='<%=CustomHeightedStyle()%>'
    > >align=center ms_positioning="FlowLayout">
    > >
    > >....some stuff...
    > >
    > ></DIV></FORM></BODY>
    > >
    > ></HTML>
    > >
    > >#
    > >#
    > >###############################
    > >
    > >I've tried usnig the "javascript:" prefix in the element
    > tag, but then the
    > >error reads that 'javascript' is undefined.
    > >your help is appreciated, thanks
    > >Dan.
    > >
    > >
    > >.
    > >

    \(Liquid\) Daniel Bass Guest

  4. #3

    Default Re: javascript function not executing...

    Exactly!!!

    That is why I removed the <%= %> from around the CLIENT
    side function as it does not exist on the SERVER yet the
    <% %> surrounds SERVER code.

    (I used capitals as emphasis - not slight is intended).

    HTH,
    Gaz
    >-----Original Message-----
    >doesn't it have to be client side since i want to get
    the containment
    >frame's height, then apply that to a DIV attribute?
    >
    >"Gary Varga" <MSNG@VargaLtd.freeserve.co.uk> wrote in
    message
    >news:0c2301c34d1f$5963e630$a401280a@phx.gbl...
    >> Are you getting confused between client and server?
    >>
    >> Should it be:
    >>
    >> >
    >> >Source Error:
    >> >
    >> >Line 39:
    >> >Line 40: <DIV ID=divOverview
    >> >Line 41: STYLE=CustomHeightedStyle()
    >> >Line 42: align=center ms_positioning="FlowLayout">
    >> >Line 43:
    >> >
    >>
    >> HTH,
    >> Gaz
    >>
    >> >-----Original Message-----
    >> >I'm trying to set the height of a DIV through the
    style,
    >> by using the frame
    >> >(orderscontrol) height and subtracting a buffer space
    >> used for some buttons
    >> >but the function in the script tags doesn't even run.
    I
    >> get the error...
    >> >
    >> >##################
    >> >#
    >> >#
    >> >
    >> >Compilation Error
    >> >Description: An error occurred during the compilation
    of
    >> a resource required
    >> >to service this request. Please review the following
    >> specific error details
    >> >and modify your source code appropriately.
    >> >
    >> >Compiler Error Message: BC30451:
    >> Name 'CustomHeightedStyle' is not declared.
    >> >
    >> >Source Error:
    >> >
    >> >Line 39:
    >> >Line 40: <DIV ID=divOverview
    >> >Line 41: STYLE='<%=CustomHeightedStyle()%>'
    >> >Line 42: align=center ms_positioning="FlowLayout">
    >> >Line 43:
    >> >
    >> >#
    >> >#
    >> >#####################
    >> >
    >> >
    >> >
    >> >and here's the HTML from the aspx page.
    >> >
    >> >
    >> >
    >> >###############################
    >> >#
    >> >#
    >> >
    >> ><body MS_POSITIONING="GridLayout">
    >> >
    >> ><SCRIPT LANGUAGE=javascript>
    >> >
    >> > function CustomHeightedStyle()
    >> > {
    >> > var frmHeight = parent.orderscontrol.height
    >> > var divHeight = frmHeight - 63
    >> > var divStyle = "Z-INDEX: 102; " +
    >> > "LEFT: 0px; " +
    >> > "OVERFLOW: auto; " +
    >> > "WIDTH: 100%; " +
    >> > "POSITION: absolute; " +
    >> > "TOP: 61px; HEIGHT: " +
    >> > frmHeight.toString() + "px"
    >> > return divStyle
    >> > }
    >> >
    >> ></SCRIPT>
    >> >
    >> ><form id=controls method=post runat="server">
    >> >
    >> ><DIV ID=divOverview
    >> >STYLE='<%=CustomHeightedStyle()%>'
    >> >align=center ms_positioning="FlowLayout">
    >> >
    >> >....some stuff...
    >> >
    >> ></DIV></FORM></BODY>
    >> >
    >> ></HTML>
    >> >
    >> >#
    >> >#
    >> >###############################
    >> >
    >> >I've tried usnig the "javascript:" prefix in the
    element
    >> tag, but then the
    >> >error reads that 'javascript' is undefined.
    >> >your help is appreciated, thanks
    >> >Dan.
    >> >
    >> >
    >> >.
    >> >
    >
    >
    >.
    >
    Gary Varga Guest

  5. #4

    Default Re: javascript function not executing...

    This ain't working...
    I'll scrap the javascript idea.
    All I want to do is have a control, header section across the top of a page,
    then a DIV beneath it so that the control doesn't scroll, but the DIV in the
    rest of the body does. In other words, simulating frame behaviour with a top
    banner/control static section and scrollable view beneath it with DIV tags.
    The problem is DIV doesn't automattically take up the remaining space so the
    idea behind my javascript was have something like

    the height of the DIV element = the height of the frame - the height of
    my control panel

    is there another way around this? I goto the help section in the style sheet
    say, and the help page does what i want to do, so i look at the source there
    and it also uses DIV's, but I can't replicate the behaviour...

    thanks again.
    Dan.


    "Gary Varga" <MSNG@VargaLtd.freeserve.co.uk> wrote in message
    news:0a0501c34d27$17d76040$a601280a@phx.gbl...
    > Exactly!!!
    >
    > That is why I removed the <%= %> from around the CLIENT
    > side function as it does not exist on the SERVER yet the
    > <% %> surrounds SERVER code.
    >
    > (I used capitals as emphasis - not slight is intended).
    >
    > HTH,
    > Gaz
    >
    > >-----Original Message-----
    > >doesn't it have to be client side since i want to get
    > the containment
    > >frame's height, then apply that to a DIV attribute?
    > >
    > >"Gary Varga" <MSNG@VargaLtd.freeserve.co.uk> wrote in
    > message
    > >news:0c2301c34d1f$5963e630$a401280a@phx.gbl...
    > >> Are you getting confused between client and server?
    > >>
    > >> Should it be:
    > >>
    > >> >
    > >> >Source Error:
    > >> >
    > >> >Line 39:
    > >> >Line 40: <DIV ID=divOverview
    > >> >Line 41: STYLE=CustomHeightedStyle()
    > >> >Line 42: align=center ms_positioning="FlowLayout">
    > >> >Line 43:
    > >> >
    > >>
    > >> HTH,
    > >> Gaz
    > >>
    > >> >-----Original Message-----
    > >> >I'm trying to set the height of a DIV through the
    > style,
    > >> by using the frame
    > >> >(orderscontrol) height and subtracting a buffer space
    > >> used for some buttons
    > >> >but the function in the script tags doesn't even run.
    > I
    > >> get the error...
    > >> >
    > >> >##################
    > >> >#
    > >> >#
    > >> >
    > >> >Compilation Error
    > >> >Description: An error occurred during the compilation
    > of
    > >> a resource required
    > >> >to service this request. Please review the following
    > >> specific error details
    > >> >and modify your source code appropriately.
    > >> >
    > >> >Compiler Error Message: BC30451:
    > >> Name 'CustomHeightedStyle' is not declared.
    > >> >
    > >> >Source Error:
    > >> >
    > >> >Line 39:
    > >> >Line 40: <DIV ID=divOverview
    > >> >Line 41: STYLE='<%=CustomHeightedStyle()%>'
    > >> >Line 42: align=center ms_positioning="FlowLayout">
    > >> >Line 43:
    > >> >
    > >> >#
    > >> >#
    > >> >#####################
    > >> >
    > >> >
    > >> >
    > >> >and here's the HTML from the aspx page.
    > >> >
    > >> >
    > >> >
    > >> >###############################
    > >> >#
    > >> >#
    > >> >
    > >> ><body MS_POSITIONING="GridLayout">
    > >> >
    > >> ><SCRIPT LANGUAGE=javascript>
    > >> >
    > >> > function CustomHeightedStyle()
    > >> > {
    > >> > var frmHeight = parent.orderscontrol.height
    > >> > var divHeight = frmHeight - 63
    > >> > var divStyle = "Z-INDEX: 102; " +
    > >> > "LEFT: 0px; " +
    > >> > "OVERFLOW: auto; " +
    > >> > "WIDTH: 100%; " +
    > >> > "POSITION: absolute; " +
    > >> > "TOP: 61px; HEIGHT: " +
    > >> > frmHeight.toString() + "px"
    > >> > return divStyle
    > >> > }
    > >> >
    > >> ></SCRIPT>
    > >> >
    > >> ><form id=controls method=post runat="server">
    > >> >
    > >> ><DIV ID=divOverview
    > >> >STYLE='<%=CustomHeightedStyle()%>'
    > >> >align=center ms_positioning="FlowLayout">
    > >> >
    > >> >....some stuff...
    > >> >
    > >> ></DIV></FORM></BODY>
    > >> >
    > >> ></HTML>
    > >> >
    > >> >#
    > >> >#
    > >> >###############################
    > >> >
    > >> >I've tried usnig the "javascript:" prefix in the
    > element
    > >> tag, but then the
    > >> >error reads that 'javascript' is undefined.
    > >> >your help is appreciated, thanks
    > >> >Dan.
    > >> >
    > >> >
    > >> >.
    > >> >
    > >
    > >
    > >.
    > >

    \(Liquid\) Daniel Bass Guest

  6. #5

    Default Re: javascript function not executing...

    If you set your div to runat server, you can control all attributes and
    styles in it programmatically. I believe that will give you all the control
    you need from the server side.

    --
    HTH,

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

    "(Liquid) Daniel Bass" <danielbassNOJUNK@MAILpostmaster.co.uk> wrote in
    message news:elib7jSTDHA.1664@TK2MSFTNGP11.phx.gbl...
    > This ain't working...
    > I'll scrap the javascript idea.
    > All I want to do is have a control, header section across the top of a
    page,
    > then a DIV beneath it so that the control doesn't scroll, but the DIV in
    the
    > rest of the body does. In other words, simulating frame behaviour with a
    top
    > banner/control static section and scrollable view beneath it with DIV
    tags.
    > The problem is DIV doesn't automattically take up the remaining space so
    the
    > idea behind my javascript was have something like
    >
    > the height of the DIV element = the height of the frame - the height of
    > my control panel
    >
    > is there another way around this? I goto the help section in the style
    sheet
    > say, and the help page does what i want to do, so i look at the source
    there
    > and it also uses DIV's, but I can't replicate the behaviour...
    >
    > thanks again.
    > Dan.
    >
    >
    > "Gary Varga" <MSNG@VargaLtd.freeserve.co.uk> wrote in message
    > news:0a0501c34d27$17d76040$a601280a@phx.gbl...
    > > Exactly!!!
    > >
    > > That is why I removed the <%= %> from around the CLIENT
    > > side function as it does not exist on the SERVER yet the
    > > <% %> surrounds SERVER code.
    > >
    > > (I used capitals as emphasis - not slight is intended).
    > >
    > > HTH,
    > > Gaz
    > >
    > > >-----Original Message-----
    > > >doesn't it have to be client side since i want to get
    > > the containment
    > > >frame's height, then apply that to a DIV attribute?
    > > >
    > > >"Gary Varga" <MSNG@VargaLtd.freeserve.co.uk> wrote in
    > > message
    > > >news:0c2301c34d1f$5963e630$a401280a@phx.gbl...
    > > >> Are you getting confused between client and server?
    > > >>
    > > >> Should it be:
    > > >>
    > > >> >
    > > >> >Source Error:
    > > >> >
    > > >> >Line 39:
    > > >> >Line 40: <DIV ID=divOverview
    > > >> >Line 41: STYLE=CustomHeightedStyle()
    > > >> >Line 42: align=center ms_positioning="FlowLayout">
    > > >> >Line 43:
    > > >> >
    > > >>
    > > >> HTH,
    > > >> Gaz
    > > >>
    > > >> >-----Original Message-----
    > > >> >I'm trying to set the height of a DIV through the
    > > style,
    > > >> by using the frame
    > > >> >(orderscontrol) height and subtracting a buffer space
    > > >> used for some buttons
    > > >> >but the function in the script tags doesn't even run.
    > > I
    > > >> get the error...
    > > >> >
    > > >> >##################
    > > >> >#
    > > >> >#
    > > >> >
    > > >> >Compilation Error
    > > >> >Description: An error occurred during the compilation
    > > of
    > > >> a resource required
    > > >> >to service this request. Please review the following
    > > >> specific error details
    > > >> >and modify your source code appropriately.
    > > >> >
    > > >> >Compiler Error Message: BC30451:
    > > >> Name 'CustomHeightedStyle' is not declared.
    > > >> >
    > > >> >Source Error:
    > > >> >
    > > >> >Line 39:
    > > >> >Line 40: <DIV ID=divOverview
    > > >> >Line 41: STYLE='<%=CustomHeightedStyle()%>'
    > > >> >Line 42: align=center ms_positioning="FlowLayout">
    > > >> >Line 43:
    > > >> >
    > > >> >#
    > > >> >#
    > > >> >#####################
    > > >> >
    > > >> >
    > > >> >
    > > >> >and here's the HTML from the aspx page.
    > > >> >
    > > >> >
    > > >> >
    > > >> >###############################
    > > >> >#
    > > >> >#
    > > >> >
    > > >> ><body MS_POSITIONING="GridLayout">
    > > >> >
    > > >> ><SCRIPT LANGUAGE=javascript>
    > > >> >
    > > >> > function CustomHeightedStyle()
    > > >> > {
    > > >> > var frmHeight = parent.orderscontrol.height
    > > >> > var divHeight = frmHeight - 63
    > > >> > var divStyle = "Z-INDEX: 102; " +
    > > >> > "LEFT: 0px; " +
    > > >> > "OVERFLOW: auto; " +
    > > >> > "WIDTH: 100%; " +
    > > >> > "POSITION: absolute; " +
    > > >> > "TOP: 61px; HEIGHT: " +
    > > >> > frmHeight.toString() + "px"
    > > >> > return divStyle
    > > >> > }
    > > >> >
    > > >> ></SCRIPT>
    > > >> >
    > > >> ><form id=controls method=post runat="server">
    > > >> >
    > > >> ><DIV ID=divOverview
    > > >> >STYLE='<%=CustomHeightedStyle()%>'
    > > >> >align=center ms_positioning="FlowLayout">
    > > >> >
    > > >> >....some stuff...
    > > >> >
    > > >> ></DIV></FORM></BODY>
    > > >> >
    > > >> ></HTML>
    > > >> >
    > > >> >#
    > > >> >#
    > > >> >###############################
    > > >> >
    > > >> >I've tried usnig the "javascript:" prefix in the
    > > element
    > > >> tag, but then the
    > > >> >error reads that 'javascript' is undefined.
    > > >> >your help is appreciated, thanks
    > > >> >Dan.
    > > >> >
    > > >> >
    > > >> >.
    > > >> >
    > > >
    > > >
    > > >.
    > > >
    >
    >

    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