Thursday, July 7, 2011

Calling a Javascript Function in asp.net

 Dim url As String = "Digital-signature.aspx?pono={0}&tskId=1"
            url = String.Format(url, e.CommandArgument)

            Dim script As String = "<script language='JavaScript' type='text/javascript'>open_win('{0}');</script>"
            script = String.Format(script, url)

            If Not ClientScript.IsClientScriptBlockRegistered("popup") Then
                ClientScript.RegisterClientScriptBlock(Page.GetType(), "popup", script)
            End If


window.js
-----------
function open_win(url_add)
   {
   window.open(url_add,'welcome',
   'width=300,height=200,menubar=yes,status=yes,
   location=yes,toolbar=yes,scrollbars=yes');
   }



2 comments:

  1. I am new to Javascript so do not have much experience.The code you provided is really helpful.Although I understood what it does but it will really be a great help if you can give a brief explanation.Thanks
    digital signatures

    ReplyDelete
  2. Loved the program Mr. Shunmugam. It is the easiest way for the call of a function.

    .net obfuscator

    ReplyDelete