2

I know if I'm using AjaxControlToolkit I need to replace:

<asp:ScriptManager

by

<ajaxToolkit:ToolkitScriptManager

But do I need to replace ScriptManager in code behind too:

ScriptManager.RegisterStartupScript

by

ToolkitScriptManager.RegisterStartupScript

I got warning there: access to a static member of a type via a derived type

UPDATE:

okay, maybe RegisterStartupScript belongs to ScriptManager and ToolkitScriptManager derived from ScriptManager? In this case it doesn't make sense to replace it for RegisterStartupScript?

1 Answer 1

3

I've used ScriptManager with the AJAX control toolkit before, no problem. I was using an older version, so maybe that requirement came later, but it may not be a requirement at all; it's possible it adds additional conveniences for you. You're getting the warning because of the inheritance there, since ToolkitScriptManager inherits from ScriptManager, that would be why. It's probably OK to use ToolScriptManager for that...

As long as it works, that's what matters most :-)

Sign up to request clarification or add additional context in comments.

3 Comments

Right now ScriptManager is used on whole site. But I read this: blogs.msdn.com/b/delay/archive/2007/06/11/… and thought that it will be better if I replace it by ToolkitScriptManager, because it's combining scripts and site should work faster. Except this we have some problems, probably related to AjaxControlToolkit, and I hoped it can fix them.
What is the actual problem because a warning doesn't prevent you from building, so are you experiencing a problem using this static method?
I asked other question: stackoverflow.com/questions/12693633/… maybe it's not related, but anyway

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.