Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

what i had to do once was how to call client-side code for server side events

a function that i found somewhere goes with

 

Public Shared Sub OpenNewWindow(ByVal Opener As System.Web.UI.WebControls.WebControl, ByVal PagePath As String)

 

Dim Clientscript As String

Dim Desc As String = "Details"

Dim misc As String = "width=720,height=830,resizable,scrollbars=yes,menubar=yes"

 

Clientscript = "window.open('" & PagePath & "', '" & Desc & "', '" & misc & "')"

 

Opener.Attributes.Add("Onclick", Clientscript)

 

End Sub

 

you'd call this function by using something like

OpenNewWindow(CType(DataGrid2.Items(temp).Cells(0).Controls(0), LinkButton), "webform2.aspx?data=34343")

 

and what all that would do is to assign a client side code to that control so that it will be activated from the client-side the next time it was pressed...so referring to your question...read up on the window.open properites...a good page for this is

 

http://64.233.161.104/search?q=cache:8bBcvavMZ8wJ:www.mozilla.org/docs/dom/domref/dom_window_ref76.html+window.open&hl=en

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...