Today, I came across a concept: the scriptmanagerproxy control in Asp.net Ajax. The framework specifies that only one scriptmanager control can be used on An ASPX page. To use Ajax, a page must have at least one scriptmanager control. However, if the master page is used, ASP is used as needed on the master page. net Ajax feature, defines a scriptmanager control, while the content page also needs to use Ajax features, you can define a scriptmanagerproxy control on the Content Page to replace scriptmanager.
So I tried to define the scriptmanager control on the master page and use the updatepanel control. The scriptmanager control is also defined on the content page, and the updatepanel control is also used. Then build. However, an error is reported during running, which is also very straightforward, that is, a page cannot contain two scriptmanager controls at the same time. So I think since the master page is actually equivalent to a direct reference, it has, and I don't need to define it in the content page, so I won't be able to simply use updatepanel. I tried it!
Then I tried the scriptmanagerproxy mentioned above, which is also successful.
There is no need to use scriptmanagerproxy and use it. The effect seems to be the same. What is the difference between the bottom? The convenience of the image is of course not easy to worry about, and it is certainly useful in essence.
I checked it and thought about it. It is almost because of the following reasons:
Since the master page can be used as a master page, it is not suitable for defining some special properties of specific pages. Specifically, for scriptmanager, Ajax applications on the content page may need to specify some special web services, or reference some special scripts and define some special attributes. At this time, it is unrealistic and unreasonable to add each content page to the master page. Therefore, you need to define it on the current content page. At this time, it cannot violate the rule that only one sm (~~) can exist on a page (~~~) The control principle can only be implemented through SMP.
Of course, if I don't need a special definition that cannot meet the requirements of the master page, I can simply omit the SMP control.