RegisterClientScriptInclude: what does the "type" parameter do?

I am currently studying the RegisterClientScriptInclude method , so I can be sure that I am not doing something like turning on jQuery twice on the same page. The Microsoft documentation states:

This overload of the RegisterClientScriptInclude method accepts key and url parameters to identify the script, as well as a type parameter to indicate client identification of the script include . You specify a type based on the object that will access the resource. For example, when using a page instance to access a resource, you specify the page type.

I do not understand what is really for me. Does this in any way mean which page / control took precedence and registered inclusion? Can someone explain why I would like to specify a type in addition to the / url switch? Thanks in advance.

+5
source share
1 answer

The type is used along with the key string to form a unique identifier. This is used to identify include so that you can call RegisterClientScriptIncludemultiple times with the same script, but it will only be included once per page.

, . , , , . ( ) , , .

+3

All Articles