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

  • Thread starter Thread starter Daniel Bass
  • Start date Start date
D

Daniel Bass

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.
 
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.
 
Marina said:
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.
 
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.
 
Back
Top