ClientScript.RegisterClientScriptBlock in ASP.NET 2.0

  • Thread starter Nathan Sokalski
  • Start date
N

Nathan Sokalski

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.
 
K

Ken Cox [Microsoft MVP]

Hi Nathan,

Try it like this:

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


Ken
Microsoft MVP [ASP.NET]
 
D

daniel #

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 #
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top