Groups | Blog | Home
all groups > vb.net > july 2006 >

vb.net : ClientScript.RegisterClientScriptBlock in ASP.NET 2.0



Nathan Sokalski
7/2/2006 9:00:58 PM
I am working on converting my code from ASP.NET 1.1 to ASP.NET 2.0. In
ASP.NET 1.1 the RegisterClientScriptBlock method was just a key and script
(2 Strings), but in ASP.NET the ClientScript.RegisterClientScriptBlock also
includes a parameter called 'type' which is of Type. This sounds like it is
supposed to specify whether the script is JavaScript, VBScript, JScript,
ECMAScript, etc., but I what am I supposed to enter here (I have not heard
of a value of Type that would specify this)? (I always use JavaScript for my
client-side scripts) Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

Ken Cox [Microsoft MVP]
7/2/2006 9:29:34 PM
Hi Nathan,

Try it like this:

ClientScript.RegisterStartupScript(Me.GetType, "Startup",
scriptString)


Ken
Microsoft MVP [ASP.NET]

[quoted text, click to view]

daniel #
7/2/2006 10:53:22 PM
Hi Nathan

RegisterClientScriptBlock doesn't know about client side scripting, the
parameter type is the object 'type', You usually get this with GetType()
method.

See ya
daniel #

[quoted text, click to view]

AddThis Social Bookmark Button