A minor question that I hope admits of a simple answer that I'll kick myself for not noticing.
So, when we have the following overload of RegisterStartupScript
public static void RegisterStartupScript(
Control control,
Type type,
string key,
string script,
bool addScriptTags
)
we have to provide a type as well as a control. Now, I can see what the point of specifying the control - the script gets pushed out just in case the control is part of the partial page render. But what is the point of the Type parameter? Usually one just sets it to the type of the control. And this is in fact the suggestion made by MSDN:
control
Type: System.Web.UI..::.Control
The control that is registering the client script block.
type
Type: System..::.Type
The type of the client script block. This parameter is usually specified by using the typeof operator (C#) or the GetType operator (Visual Basic) to retrieve the type of the control that is registering the script.
So why do we have to specify it? Presumably not just to spare the .Net Framework the bother of retrieving the runtime type itself.