clientscript is not declared error.

Hi,

 I have used the wizard to convert asp.net 1.x to asp.net 2.0 website.

I have a utiliities.vb class file that contains a public class utiliites.

 A shared function called JavaMessagebox uses the registerclientscriptblock.

The problem is that I am getting the clientscript is undeclared with the following code statement:

ClientScript.RegisterClientScriptBlock(pg.GetType(), "ClientScript", scripting)

Normally this code would be in the code-beside? (formally codebehind) file and would see this class because of the

Inherits System.Web.UI.Page


However I can't add the inherits statmenet to a public class.

Should I just migrate out this code and put it in my webpages? I'd prefer to get it working without pasting it into
the code behind page for the webpage that call this JavaMessageBox function.

 

Thanks

Haggisns


Haggisns
0
haggisns
2/19/2009 9:42:53 PM
asp.net.migrating-from-1.x-2.0 1016 articles. 0 followers. Follow

2 Replies
1252 Views

Similar Articles

[PageSpeed] 9

 use like

Page.ClientScript.RegisterClientScriptBlock

looks like you are having a varible called Pg that is your Page so u can call like Pg.ClientScript.RegisterClientScriptBlock as well


Raghu
(MCSD.NET, MCAD.NET, MCDBA)
[Don't forget to click on Mark as answer on the post that helped you ]
0
rmaiya
2/19/2009 10:30:33 PM

duh!.. thanks rmaiya :), I totally space out on that one, even my limited OO knowledge should have figured that one out.

 thanks, it works.


Haggisns
0
haggisns
2/20/2009 2:04:52 PM
Reply:

Web resources about - clientscript is not declared error. - asp.net.migrating-from-1.x-2.0

CanesInSight
... provides analysis on Miami Hurricanes Athletics. We have one of the most active Miami message boards on the internet. '); var yuipath = 'clientscript/yui'; ...

HotCouponWorld
'); var yuipath = 'clientscript/yui'; var yuicombopath = ''; var remoteyui = false; } else // Load Rest of YUI remotely (where possible) { var ...

CodeSOD: Take a Walk on the Client Side
... { SearchTextBox.Text = Request.QueryString["input"].ToString(); string script = " \r\n"; Page.ClientScript.RegisterStartupScript(typeof(Page), ...

CanesInSight - Miami Hurricanes Sports and Recruiting News
... provides analysis on Miami Hurricanes Athletics. We have one of the most active Miami message boards on the internet. '); var yuipath = 'clientscript/yui'; ...

HotCouponWorld
... coupons, grocery store coupon matchups, printable coupons, coupon trading, coupon database, coupon trading, deals '); var yuipath = 'clientscript/yui'; ...

Resources last updated: 12/5/2015 5:11:27 AM