javascript function not executing...

Discussion in 'ASP .Net' started by Gary Varga, Jul 18, 2003.

  1. Gary Varga

    Gary Varga Guest

    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, Jul 18, 2003
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:0c2301c34d1f$5963e630$...
    > 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, Jul 18, 2003
    #2
    1. Advertising

  3. Gary Varga

    Gary Varga Guest

    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" <> wrote in

    message
    >news:0c2301c34d1f$5963e630$...
    >> 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, Jul 18, 2003
    #3
  4. 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" <> wrote in message
    news:0a0501c34d27$17d76040$...
    > 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" <> wrote in

    > message
    > >news:0c2301c34d1f$5963e630$...
    > >> 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, Jul 18, 2003
    #4
  5. 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
    http://www.takempis.com
    Big things are made up of
    lots of little things.

    "(Liquid) Daniel Bass" <> wrote in
    message news:...
    > 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" <> wrote in message
    > news:0a0501c34d27$17d76040$...
    > > 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" <> wrote in

    > > message
    > > >news:0c2301c34d1f$5963e630$...
    > > >> 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, Jul 18, 2003
    #5
    1. Advertising

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. Guadala Harry
    Replies:
    4
    Views:
    1,494
    =?Utf-8?B?aGFyaSBwcmFzYWQ=?=
    Jun 15, 2004
  2. =?Utf-8?B?Sm9obiBXYWxrZXI=?=

    Help - Registered Javascript not executing

    =?Utf-8?B?Sm9obiBXYWxrZXI=?=, May 23, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,228
    =?Utf-8?B?Sm9obiBXYWxrZXI=?=
    May 23, 2005
  3. Mic
    Replies:
    5
    Views:
    13,505
    Alexey Smirnov
    Aug 31, 2007
  4. Vijay
    Replies:
    1
    Views:
    78
  5. Replies:
    0
    Views:
    85
Loading...

Share This Page