all groups > asp.net building controls > may 2004 >
You're in the

asp.net building controls

group:

RegisterStartupScript and IsStartupScriptRegistered not shown in listed methods of Page


RegisterStartupScript and IsStartupScriptRegistered not shown in listed methods of Page andborges NO[at]SPAM hotmail.com
5/27/2004 9:30:41 AM
asp.net building controls:
Hi All,

I'm building an Webcontrol and overriding OnPreRender i want inject
client javascript, but RegisterStartupScript and
IsStartupScriptRegistered is not been shown in the list of methods of
Page object.

If i put Page.IsStartupScriptRegistered or Page.RegisterStartupScript
in code i don't get an Compile-Time error, but a Runtime error occurs:
NullReferenceException

Thanks in advance

Re: RegisterStartupScript and IsStartupScriptRegistered not shown in listed methods of Page samgeribo NO[at]SPAM yahoo.com
5/28/2004 1:04:32 AM
My guess is you are not adding this web control to the page properly
when testing it. Do you declare this control in an aspx or ascx page?
Or do you use this.Controls.Add(mycontrol) somewhere? You must do
one or the other for Page to be not null during PreRender.

-Sam


[quoted text, click to view]
Re: RegisterStartupScript and IsStartupScriptRegistered not shown in listed methods of Page Natty Gur
5/28/2004 3:46:52 AM
Hi,

If you use VB.NET it's known issue. you wont see those methods with
intellisense but you can use them (you wont get any compile error).


HTH

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377


*** Sent via Developersdex http://www.developersdex.com ***
Re: RegisterStartupScript and IsStartupScriptRegistered not shown in listed methods of Page Teemu Keiski
5/28/2004 9:24:38 AM
Hi,

can you post some of your code?

-
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke


[quoted text, click to view]

AddThis Social Bookmark Button