why doesn't this script creation, from .aspx.vb work, for this event handler???

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

  1. #1

    Default why doesn't this script creation, from .aspx.vb work, for this event handler???

    where szStartDate, szEndDate, szStatus, szMsgType,
    szClient, szFilter are all strings declared and
    containing data as this code executes...

    ' hook up a refresh event to the refresh button

    Dim RefreshScript As New System.Text.StringBuilder
    RefreshScript.Append("<SCRIPT
    language=""javascript"">")
    RefreshScript.Append("function RefreshGrid(
    szStartDate, szEndDate, szStatus, szMsgType, szClient,
    szFilter )")
    RefreshScript.Append("{")
    RefreshScript.Append(" alert( ""HOOTS
    ALORS!!!"" );")
    RefreshScript.Append(" var url
    = ""overview.aspx?StartDate="",
    szStartDate, ""&EndDate="", szEndDate, ""&Status="",
    szStatus,""&MsgType="", szMsgType,""&Client="",
    szClient,""&Filter="", szFilter ;""")
    RefreshScript.Append(" alert ( "" The URL to
    be refreshed iiiissssssss...."");")
    RefreshScript.Append(" alert ( url ); ")
    RefreshScript.Append("
    parent.overview.location.href = url; ")
    RefreshScript.Append("}")
    RefreshScript.Append("</SCRIPT>")

    RegisterClientScriptBlock("RefreshScript",
    RefreshScript.ToString)

    Dim ProcCall = "javascript:RefreshGrid( """ &
    szStartDate & """, """ & _
    szEndDate
    & """, """ & _
    szStatus
    & """, """ & _
    szMsgType
    & """, """ & _
    szClient
    & """, """ & _
    szFilter
    & """ );"
    btnRefresh.Attributes("onclick") = ProcCall



    clicking on the button, "btnRefresh" does nothing.
    all i'm trying to do is get a the "overview" frame to
    refresh with the listed frames, calling upto the parent,
    then back down to the frame in question.

    i don't even get the first alert to fire off, so the
    function's not even being entered.
    i've tried :
    - executing the function with no parameters present
    - putting the script in script tags on the aspx page

    at best if i replace the call to the function with just
    an "alert..." call in the attributes.add call, i see the
    alert, but only when pressing the button a second time???
    why is that?!?!

    Thanks!
    Dan.
    Daniel Bass Guest

  2. Similar Questions and Discussions

    1. Use standard ASPX page as a HTTP handler
      Hi I would like to use an existing ASPX page as a HTTP handler so that I can do something like this.... <system.web> <httpHandlers> <add...
    2. DataGrid's UpdateCommand event handler and CancelCommand handler problem
      I am having the same problem: the wrong event handler is being fired when column headings and page changes are clicked. I am using the datagrid...
    3. Assign Javascript event handler function dynamically to a Flash object event?
      I have a Flash player object embedded in one of my web pages. I want to assign code to the OnReadyStateChange event for the object. Every...
    4. Event Handler
      I had made an UserControl (.ascx) which include a datalist control. The datalist control had contains an imagebutton. Next, I would like to...
    5. Dynamic creation of web pages without .aspx files
      I am experimenting with dynamically creating pages containing custom controls in response to http requests caught by an http handler, in place of...
  3. #2

    Default formatted better... why doesn't this script creation, from .aspx.vb work, for this event handler???

    where szStartDate, szEndDate, szStatus, szMsgType,
    szClient, szFilter are all strings declared and
    containing data as this code executes...

    ' hook up a refresh event to the refresh button

    Dim RefreshScript As New System.Text.StringBuilder
    RefreshScript.Append("<SCRIPT language=""javascript"">")
    RefreshScript.Append("function RefreshGrid( szStartDate, szEndDate, szStatus, szMsgType, szClient, szFilter )")
    RefreshScript.Append("{")
    RefreshScript.Append(" alert( ""HOOTS ALORS!!!"" );")
    RefreshScript.Append(" var url = ""overview.aspx?StartDate="", szStartDate, ""&EndDate="", szEndDate, ""&Status="", szStatus,""&MsgType="", szMsgType,""&Client="", szClient,""&Filter="", szFilter ;""")
    RefreshScript.Append(" alert ( "" The URL to be refreshed iiissssssss...."");")
    RefreshScript.Append(" alert ( url ); ")
    RefreshScript.Append(" parent.overview.location.href = url; ")
    RefreshScript.Append("}")
    RefreshScript.Append("</SCRIPT>")

    RegisterClientScriptBlock("RefreshScript", RefreshScript.ToString)

    Dim ProcCall = "javascript:RefreshGrid( """ & szStartDate & """, """ & _
    szEndDate & """, """ & _
    szStatus & """, """ & _
    szMsgType & """, """ & _
    szClient & """, """ & _
    szFilter & """ );"
    btnRefresh.Attributes("onclick") = ProcCall



    clicking on the button, "btnRefresh" does nothing.
    all i'm trying to do is get a the "overview" frame to
    refresh with the listed frames, calling upto the parent,
    then back down to the frame in question.

    i don't even get the first alert to fire off, so the
    function's not even being entered.
    i've tried :
    - executing the function with no parameters present
    - putting the script in script tags on the aspx page

    at best if i replace the call to the function with just
    an "alert..." call in the attributes.add call, i see the
    alert, but only when pressing the button a second time???
    why is that?!?!

    Thanks!
    Dan.
    Daniel Bass Guest

  4. #3

    Default Re: why doesn't this script creation, from .aspx.vb work, for this event handler???


    "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
    news:uJcOQeWQDHA.1072@TK2MSFTNGP10.phx.gbl...
    > Have you looked at the rendered HTML to see what it looks like?
    yep, i took the HTML text I originally put in and just placed quotes around
    it... i moved it here because i wasn't sure if the aspx page was in the
    scope of the aspx.vb page.
    > Is the client side event handler being registered properly?
    i don't know, how do i tell?

    > Does the HTML look the way it is supposed to?
    yep.


    Daniel Bass Guest

  5. #4

    Default Re: why doesn't this script creation, from .aspx.vb work, for this event handler???

    Well, you can tell if everything is registered properly by looking at the
    HTML and seeing if the onclick handler is pointing to the right function
    etc. By looking at your function and making sure it's valid javascript.

    If your page is then not behaving normally, then this is a
    browser/javascript issue, not an ASP.NET issue. Once this stuff is on the
    client, asp.net is not involved. If your javascript is right, and the
    button's onclick handler is set correctly, and things are still not
    functioning properly - then asp.net is not involved.

    "Daniel Bass" <danielbass@postmaster.co.uk> wrote in message
    news:uDe7NtWQDHA.3236@TK2MSFTNGP10.phx.gbl...
    >
    > "Marina" <zlatkinam@nospam.hotmail.com> wrote in message
    > news:uJcOQeWQDHA.1072@TK2MSFTNGP10.phx.gbl...
    > > Have you looked at the rendered HTML to see what it looks like?
    >
    > yep, i took the HTML text I originally put in and just placed quotes
    around
    > it... i moved it here because i wasn't sure if the aspx page was in the
    > scope of the aspx.vb page.
    >
    > > Is the client side event handler being registered properly?
    >
    > i don't know, how do i tell?
    >
    >
    > > Does the HTML look the way it is supposed to?
    >
    > yep.
    >
    >

    Marina 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