Ask Daniel, why can't I find a Web service in VS20 13?
When you use a user control in a Web Parts application, you can take advantage of all the functions of the Web Parts control at run time. For more information, see Using ASP.NET Server Controls in Web Parts Applications. User controls also retain their normal functionality as server controls, with one exception: output caching is disabled on user controls used in Web Parts applications. For each page request, the Web Parts control set requires that all controls be added to the control tree. Personalization must work properly and personalized data can be returned to the control. However, if the output cache is enabled on the user control, the control will not be added to the control tree, which will conflict with the Web Parts functionality. This is why user controls in Web Parts applications are designed to disable output caching. Create a Web Part Page that hosts user controls Create a new ASP.NET page. Add the following page statement at the top of the page. Under the page declaration just added, VBC# adds the following basic page structure with HTML tags. Web partsdemopageweb partsusercontroldemonstration saves this page to a directory under the website where personalization is enabled. Add a Web Parts control to the page. Add a WebPartManager control directly below the page element. Right below the element, in the middle of the first set of tags (the first table column) of the table, add a WebPartZone control to contain the user control that you will add in the following steps. In the element of the zone you just added, add an existing server control and some static content, which will be treated as another Web Part control at runtime (because it is in the WebPartZone): ASP. netsitegotdotnetcontoso.com adds another Web Part zone control in the second set of tags (the second table column) of the table to contain the user control that you will add in the following steps. In the third element (the third column) of the table, add an element. Add elements, and then add and elements. The code in the editor area should look like this: Save the page. Create a user control Create a new file in a text editor. This file will contain user controls that can also be added to the page as Web Parts controls. Note that the search control in this exercise does not realize the actual search function; It is only used to demonstrate the functions of Web Parts. At the top of the new file, add a control declaration as shown in the following example. VBC# adds a pair of C# under the control declaration, and adds a text box and a button under the element to provide a basic user interface for searching the control, as shown in the following code example. Name the file SearchUserControlVB.ascx or SearchUserControlCS.ascx (depending on the language you use) and save it in the directory where the WebPartsDemo.aspx page is located. Security Description This control has a text box for accepting user input, which is a potential security threat. User input in web pages may contain malicious client scripts. By default, ASP.NET Web pages validate user input to ensure that it does not contain HTML elements or scripts. As long as this validation is enabled, there is no need to explicitly check scripts or HTML elements in user input. For information, see Overview of Script Intrusion. Reference the user control in the main Web Part area at the top of the page. Add the following statement after the page declaration to refer to the user control you just created. If you are not using the user control example provided in this topic, you need to set the src property to the path and file name of the user control you are using, and you can also choose to assign a different value to the tagname property. [VB][C#] In the element of the main area, reference the user control created earlier. Save and close this page.