Mark,
thank you for your reply. I have added the following code to my page:
Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
AddHelpScript()
End Sub
Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.LoadComplete
Dim lb As LinkButton = gvAssets.HeaderRow.FindControl("lbEstValue")
If Not lb Is Nothing Then
lb.Attributes.Add("onClick", "doHelp()")
End If
End Sub
Protected Sub AddHelpScript()
Dim s As String
s = "<scriptfunction doHelp(){window.open('EstValueHelp.aspx',
'_help', 'width=400, height=400');}</script>"
Page.ClientScript.RegisterStartupScript(Me.GetType (), "helpWindow", s)
End Sub
Behavior is such:
The window opens the first time the linkbutton is click but not on
subsequent clicks. Also, it looks like the page is doing a postback when the
linkbutton is clicked. I have enableViewstate disabled.
I would like for the window to open up when ever the linkbutton is clicked.
The linkbutton is in the header of a gridview for a particular column. Also,
it would be nice if no postback occured.
Any other thoughts on this?
As to your #3 below, it would be really nice to go to vs2008, which I do
have installed on my machine, but, our company is stuck with IE6 for the
time being (there are apps in use that do not comply with IE7 and those are
not being migrated as of yet) and I have already played with popups in
VS2005 (AJAX) and the behavior is odd in IE6. Allen says this is a known
issue with IE6.
S
"Mark Rae [MVP]" <mark@markNOSPAMrae.netwrote in message
news:%235bmt6RGJHA.1020@TK2MSFTNGP06.phx.gbl...
Quote:
"SAL" <SAL@nospam.nospamwrote in message
news:O6wjzdRGJHA.3396@TK2MSFTNGP05.phx.gbl...
>
Quote:
>Any help would be much appreciate.
>
A couple of things:
>
1) Using Response.Write to write out JavaScript isn't recommended. Use
this instead:
>
ClientScript.RegisterStartupScript(GetType(), "helpWindow",
"window.open('EstValueHelp.aspx','_help', 'width=400,height=400');",
true);
>
or
>
ClientScript.RegisterClientScriptBlock(GetType(), "helpWindow",
"window.open('EstValueHelp.aspx','_help', 'width=400,height=400');",
true);
>
depending on when you want the script to run:
http://www.google.co.uk/search?sourc...entscriptblock
>
>
2) Debugging an ASP.NET app in Visual Studio is very different from
running an ASP.NET app in a production environment. When a browser window
is open, there is no permanent link back to the server. This is
fundamental to the disconnected architecture of browser-based
applications. The browser sends a request to the webserver, the webserver
processes the request and sends back a response to the browser - there is
no permanent connection. After the response has been sent, the server has
no idea whether the browser window is still open or not. So no memory
leak.
>
>
3) As for making sure "child" windows get closed, there is really no
built-in mechanism for this. Have you considered moving to Visual Studio
2008? This would allow you to use the AJAX modal popup extender - then
your current problem would simply disappear. It would also make the modal
popup immune to popup blockers:
http://www.javascript-coder.com/wind...le-popup.phtml
>
>
--
Mark Rae
ASP.NET MVP
http://www.markrae.net