ScriptManager control in ASP. NET AJAX

Source: Internet
Author: User

In ASP. net ajax, because An ASPX Page can only have one ScriptManager control, in the case of Master-Page, if you need to introduce different scripts in Master-Page and Content-Page, you need to use the ScriptManagerProxy control in Content-page instead of ScriptManager, scriptManagerProxy and ScriptManager are two very similar controls. Simple definitions of ASP. net ajax are as follows:

 
 
  1. <asp:ScriptManagerProxyidasp:ScriptManagerProxyid="ScriptManagerProxy1"runat="server"> 
  2. <Services> 
  3. <asp:ServiceReferencePathasp:ServiceReferencePath="CalculWebService.asmx"/> 
  4. </Services> 
  5. </asp:ScriptManagerProxy> 

The following sub-tags can be added: Services, Scripts, AuthenticationService, ProfileService

Add a Master-Page, add a ScriptManager control on it, introduce WebService SimpleWebService. asmx, and add corresponding HTML elements:

 
 
  1. <Div> 
  2. <Asp: ScriptManagerIDAsp: ScriptManagerID= "ScriptManager1"Runat= "Server"> 
  3. <Services> 
  4. <Asp: ServiceReferencePathAsp: ServiceReferencePath=
    "SimpleWebService. asmx"/> 
  5. </Services> 
  6. </Asp: ScriptManager> 
  7. <Asp: contentplaceholderidAsp: contentplaceholderid=
    "ContentPlaceHolder1"Runat= "Server"> 
  8. </Asp: contentplaceholder> 
  9. & Nbsp;<H3>Enter the name:</H3> 
  10. <InputidInputid= "InputName"Type= "Text"/> 
  11. <InputidInputid= "Button"Type= "Button"Value= "OK"Onclick=
    "ReturnOnbuttonGo_click ()"/> 
  12. </Div> 

Add a Content-Page, add a ScriptManagerProxy control on it, introduce WebService CalculWebService. asmx, and add corresponding HTML elements:

 
 
  1. <Div> 
  2. <Asp: ScriptManagerProxyidAsp: ScriptManagerProxyid=
    "ScriptManagerProxy1"Runat= "Server"> 
  3. <Services> 
  4. <Asp: ServiceReferencePathAsp: ServiceReferencePath=
    "CalculWebService. asmx"/> 
  5. </Services> 
  6. </Asp: ScriptManagerProxy> 
  7. <H3>Enter two numbers:</H3>& Nbsp;<InputidInputid= "InputA"Type=
    "Text"Style="Width: 110px"/>& Nbsp; + & nbsp;
  8. <InputidInputid= "InputB"Style= "Width: 110px"Type="Text"/>& Nbsp;
  9. <InputidInputid= "ButtonEqual"Type= "Button"Value= "="Onclick=
    "ReturnOnbuttonEqual_click ()"/> 
  10. </Div> 

About ASP. in net ajax, The ScriptManagerProxy control is introduced here. The question is, in my IDE, why does ScriptManagerProxy always prompt that it is an unknown element, but it does not run correctly and the result can also be displayed?

  1. Introduction to ASP. net mvc Framework
  2. MvcContrib. FluentHtml of ASP. NET MVC
  3. Functions of ASP. NET Framework and Application of ASP. net mvc pattern
  4. Analysis of Asp.net MVC Lifecycle
  5. Overview of ASP. net ajax Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.