Active Server Pages ( ASP.NET)

Size: px
Start display at page:

Download "Active Server Pages ( ASP.NET)"

Transcription

1 Object-Oriented Programming Chapter 9 Active Server Pages ( ASP.NET) 241

2 Chapter 9 Active Server Pages ( ASP.NET) Chapter 9 Active Server Pages ( ASP.NET) ASP.NET is an object-oriented, event-driven platform for writing Web-based applications. Some of the major improvements and benefits that ASP.NET gives you: Using the various caching methods in ASP.NET Using the Web.Config configuration file, you can implement robust page- and directory-level security without writing code for each page. You have the same Code Editor features that Windows Forms applications have. Debugging ASP.NET applications is just like debugging Windows applications. A lot of controls, including validation controls, grid controls, and list controls. ASP.NET applications are 100% compiled. 242

3 Object-Oriented Programming Hello ASP.NET! In the New Project dialog. Select the ASP.NET Web Application. Change the name of the application to or Visual Studio creates the virtual Web directory at the location you specify in the name of the project. In this case, localhost, which is the default name for the local Web server running on your machine. Physically it is created in \inetpub\wwwroot\helloweb_cs or \inetpub\wwwroot\helloweb_vb directory. In Visual Studio Projects folder under My Documents, you'll see HelloWeb_vb or HelloWeb_cs directory, containing only the solution file. The Webform1.aspx file has a Webform1.aspx.vb and Webform1.aspx.resx underneath it in the tree view. The codebehind file has the same name of the ASPX file, but with the.cs or.vb extension. The.resx file is the resource file, which contains localization information for the Form. 243

4 Chapter 9 Active Server Pages ( ASP.NET) If you click the HTML button in the lower left of the Web Forms Designer, and click the Design button in the lower-left corner of the HTML designer, you're taken back to the design surface for the ASPX page. To get to the code-behind file, you can double-click the ASPX page, you can press the F7 key, or you can double-click class file in the Solution Explorer. The class file inherits the System.Web.UI.Page class. When an ASP.NET application is compiled, the code-behind files for each ASPX page are compiled into a single assembly with a DLL extension and are placed in the Bin directory. Files That Make Up an ASP.NET Web Application Webform1.aspx 244 The visual part of the Web Form. You can modify the HTML to pass the user interface of a Web form or drag controls from the Toolbox onto it. WebForm1.aspx.cs Code-behind class file that the ASPX file inherits its functionality from. Web.Config Global.asax Styles.css AssemblyInfo.vdisco XML-based configuration file for the project. You can set properties on security, caching, state, and tracing information in Web.Config file. Contains application-level events for an ASP.NET project. Default style sheet for a project. You can double-click.css files to edit them in the Style Sheet Designer. Contains assembly-specific information for the project's assembly output. Discovery file for XML Web services in the application. More about it in : "XML Web Service in.net".

5 Object-Oriented Programming Adding Controls to a Web Form Adding controls to a Web Form is like adding to a Windows Form. You visually design a page by dragging predefined controls from Toolbox onto the Web Form. HTML controls are the same HTML-tag-based controls you use in a regular HTML page. Server controls offer a richer user interface, and have an object model that you can access in the code-behind class files for an ASPX page. Drag an HTML text field to the ASPX page and then drag a TextBox server control. 245

6 Chapter 9 Active Server Pages ( ASP.NET) If you switch to the HTML view in the designer, you'll see : <body> <form id="form1" method="post" runat="server"> <P><asp:TextBox id="textbox1" runat="server"></asp:textbox></p> <P> </P> <P> <INPUT type="text"></p> </form> </body> By adding the runat=server attribute to any control, be it an HTML control or a server control, you can access the control from the inherited code-behind file. protected System.Web.UI.WebControls.TextBox TextBox1; Notice that the HTML Input control isn't declared in the codebehind file. Switch to the HTML view of the WebForm1.aspx page and modify the HTML Input control to look like this: <INPUT type="text" runat="server" id="htmltextbox"> Then save the page and switch back to the code-behind class. You'll notice this declaration: protected System.Web.UI.HtmlControls.HtmlInputText HtmlTextBox; 246

7 Object-Oriented Programming what's the difference, and why would you use HTML controls instead of server controls? Server controls don't expose client events; HTML controls do. In other words, you can't use client-side JavaScript or VBScript with a control that has a runat=server attribute. Server controls offer a rich object model in the code-behind class that enables you to program Web applications in a way that's similar to writing Windows applications by responding to events and setting properties. Both sets of controls offer auto-complete and auto-list members in the HTML view, so that functionality isn't specific to one type of control. There's overhead associated with using server controls. Because server controls must be part of the compiled assembly and processed by the ASP.NET runtime on the server, it isn't always as efficient as using a straight HTML control. Any HTML element can have a runat=server attribute!! Example, let's say you have an HTML table, and you need to change the color of a table cell, based on something that occurs in a server event. If you add the runat=server attribute to the TD HTML element and give it an ID, the code-behind class will have the following declaration: Protected WithEvents TD1 As System.Web.UI.HtmlControls.HtmlTableCell In your code, you can then use a Select Case to set Style attributes on the HtmlTableCell object: Select Case Request("AlertStatus") Case "Red" : TD1.Attributes.Add("background", "red.jpg") Case "Yellow" : TD1.Attributes.Add("background", "yellow.jpg") Case Else : TD1.Attributes.Add("background", "green.jpg") End Select 247

8 Chapter 9 Active Server Pages ( ASP.NET) Responding to Server Control Events Steps to modify the WebForm1.aspx page, to write a simple login form.. 1. Make sure that you're in the Web Forms Designer. 2. Delete the HTML text field control and the TextBox server control from the form. 3. From the Table menu, select Insert, Table. 4. Click the OK button to add default table with 3 columns and 3 rows. 5. Drag two Label controls from the Web Forms to the first two rows in the first column of the table. Change their Text property to User Name and Password, respectively. 6. Drag two TextBox controls to the first two rows in the second column of the table. Change their Name property to UserName and Password, respectively. 7. Drag a Button control to the third row on the second column in the table, and change its Text property to Log In and change its Name property to LogIn. By default, the Web Forms Designer defaults to absolute positioning and grid layout. Absolute positioning sets the x and y coordinates of each control using the Style property. I'm accustomed to using Table to position my HTML elements. To use FlowLayout, right-click ASPX page and set its Page Layout property to FlowLayout. 248

9 Object-Oriented Programming Double-click on the Log In button to get to its Click event, and add the following code, which writes out the contents of the TextBoxes to the form. private void LogIn_Click(object sender, System.EventArgs e) { Response.Write(UserName.Text); Response.Write("<br>"); Response.Write(Password.Text); Response.End(); } Right-click the WebForm1.aspx page in the Solution Explorer and select Build and Browse, the page will be compiled and displayed in the internal browser of Visual Studio.NET. ASP.NET pages run from the compiled assembly in the Bin directory. So, if you make any changes to your code-behind files, you must rebuild the solution to make sure that you're working with the current version of the files. Changes to standard HTML are not compiled until the page is accessed, so you can select Save All Files from File menu to save HTML changes have been ( no need to rebuild the project) After the page is displayed in the browser, enter values in the UserName text box and the Password text box and click the Log In button. Using Validation Controls When you validate a control, you're checking whether a control has data in it and conforms to a specific pattern, (such as an address), or you're checking the range of data entered. Five validation controls in Toolbox that you can drag to a form and associate with a control. 249

10 Chapter 9 Active Server Pages ( ASP.NET) RequiredFieldValidator Forces the user to enter a value into the specified control. CompareValidator RangeValidator RegularExpression Validator Compares a user's entry against a constant value, or against a property value of another control, using a comparison operator. Checks user's entry is between specified lower and upper boundaries. Ranges are pairs of numbers, alphabetic characters, dates. Checks that the entry matches a pattern defined by a regular expression. Each validatior has Text (displays text) and ErrorMessage property (displays if an error occurs). RequiredFieldValidator has a ControlToValidate which takes ID of a valid control on the form. Add, Add Web Form. change the name from WebForm2.aspx to Success.aspx, Double-click Success.aspx to get to the Form_Load event for the page, and add the code : private void Page_Load(object sender, System.EventArgs e) { Response.Write("<H1>You are now logged in</h1>"); } To modify the WebForm1.aspx page, you must do the following: 1. Add a new table row above the Log In button. by clicking inside the cell that contains the Log In button, and then right-clicking and selecting Insert, Row Above from the contextual menu. 2. Drag a Label and TextBox. Change the Text of the Label to 250

11 Object-Oriented Programming Re-Enter Password, and change the ID property of the TextBox to Password2. 3. Change the Text of the Label control that says UserName: to now say Address:. 4. Drag a RequiredFieldValidator, and place it in the column next to the Username TextBox. 5. Drag a RegularExpressionValidator and place it next to the RequiredFieldValidator. 6. Drag a RequiredFieldValidator and place it in the column next to the Password TextBox. 7. Drag a CompareValidator and place it in the column next to the Password2 TextBox. The next step is to set the properties on the validation controls. 1. Select the RequiredFieldValidator1 control, and change the ControlToValidate property to UserName. Then change the ErrorMessage property to " Address Required". 2. Select RegularExpressionValidator. In ValidationExpression, click ellipses ( ) button to get Regular Expression Editor. Select Internet Address and click OK. Change ErrorMessage to "Invalid Format". Change ControlToValidate to Username. 3. Select the RequiredFieldValidator2 control, and change the ControlToValidate property to Password. Then change the ErrorMessage property to "Password Required". 4. Select CompareValidator1, and change ControlToCompare to Password. Change ControlToValidate to Password2. Change ErrorMessage to "Passwords do not match". 251

12 Chapter 9 Active Server Pages ( ASP.NET) Rename the WebForm1.aspx to Login.aspx. By right-clicking it and selecting Rename. Now, double-click the Log In button, and add the code: private void LogIn_Click(object sender, System.EventArgs e) { if (UserName.Text == "jason@mams.net" && Password.Text == "password") Response.Redirect(@"Success.aspx"); } To make user interface more friendly, you can set InitialValue of RequiredFieldValidator to a red asterisk. You should also set TextMode of Password and Password2 text boxes to Password so that the data entered into the field is filled with asterisks. Build. Enter text that isn't address, and different passwords in Passwords textboxes. Validation occurs on the client and the page isn't posted to the server until the data is correct. To display a summary of validation errors, you can use the ValidationSummary control on a page. This takes all the validation errors on the page, and places them in a nice bulleted list. You can use the ShowMessageBox property set to True. To validate a page in server-side code, you check the IsValid property of a page. o by setting the EnableClientScript property to False for each validation control. o In the Page_Load event checks the IsValid property to check controls on the page. 252

13 Object-Oriented Programming If Page.IsValid Then If UserName.Text = "jason@mans.net" And Password.Text = "password" Then Response.Redirect("Success.aspx") Else LogIn.Text = "Invalid Data, please retry" End If End If Managing State in ASP.NET Web Applications o The Internet is a stateless application. The challenge is to keep track of where the user is in your Web application, and where to take his next. This is done by maintaining state. o you keep state on the client or on the server. Managing State on the Client ( page-level state in the browser). 1. Using Cookies o Cookies are a key-value paring of collection data that are saved on the client's hard drive. o If client closes the browser and revisits your site, you check for the cookie in a Page_Load. o You can modify Web.Config to use sessionless cookies, i.e. cookie data is encrypted and passed in the query string of the browser, so no data is actually stored on user's machine. <sessionstate mode="inproc" stateconnectionstring="tcpip= :42424" sqlconnectionstring="data source= ;user id=sa;password=" cookieless="true" timeout="20" /> o To access cookies in code, you access Cookies of the Request or Response object 253

14 Chapter 9 Active Server Pages ( ASP.NET) Dim cookie As HttpCookie = Request.Cookies("UserID") If cookie Is Nothing Then Response.Cookies("UserID").Value = "Jason" Response.Cookies("UserID ").Expires = "January 1, 2010" Response.Cookies("UserID ").Path = "/" Else Response.Write(Request.Cookies("UserID") End If You must set Expires to save the cookie, else the cookie is deleted when session ends. 2. Understanding View State o Each control and ASPX page has an EnableViewState property ( True by default). o When a page is processed that has ViewState enabled, a hidden field named Viewstate is added to the ASPX page and all the page data for the form is preserved in it. o ViewState is a page-level state management option. o Because the page data is kept in the hidden control, the page size can grow. o You can set ViewState data in code, similar to a Cookies or Session object, as: Viewstate("UserID") = "Bob" 3. Using the HTML Hidden Control o Using hidden fields is a common way to store information in ASP. o You can set the Value property of the control to store pagespecific information. 254

15 Object-Oriented Programming 4. Using the Query String o HTTP-GET is set using the Method=Get attribute on Form tag in the HTML of your page, you automatically send all the data in the fields through the query string of the browser. o When you pass values of a form using HTTP-GET, the initial control ID is separated from the requested page by an ampersand, and the remaining fields are separated by the question mark character. If you were to pass the data to the Success.aspx page using HTTP-GET in the code you wrote for the Login.aspx page, the query string is: assword=password Managing State on the Server To manage state on the server side, you use either session state or application state. 1. Using Session State Using session-level state enables you to track variable data for a user throughout his visit. Using the HttpSessionState class, same key-value syntax that you use for ViewState. Each time a browser hits your site, IIS creates a unique session ID for the browser session if you access the Session object in code. If you don't reference the Session object in code, IIS doesn't create a unique ID for the end user's session on your site. Session information is useful to save data between multiple page calls. For example, when I visit my bank's Web site, I must enter my username and password every time I visit. But after I log in to the site, each page I navigate knows who I am, so the data is being passed to all pages for my session through the use of session state. To set or retrieve values for session state, you use this syntax: 255

16 Chapter 9 Active Server Pages ( ASP.NET) 256 If Session("UserID") = "Bob" then... Reponse.Write(Session("UserID")) After the browser is closed or the end user navigates to another site, session data is lost. When user returns to site, he must create new session data based on current session. Web.Config file gives you options as to where session-level state can be stored for a site. By default, session state is stored in the same process as IIS. You can store session state in SQL Server. By modifying mode attribute in the sessionstate section : <sessionstate mode="sqlserver" stateconnectionstring="tcpip= :42424" sqlconnectionstring="data source= ;user id=sa;password=" cookieless="false" timeout="20" /> You must also supply the correct authentication information, and run a special SQL script that creates database and temporary tables in SQL Server to hold the state data. In Global.asax file, you can write code in Session_OnStart and Session_OnEnd events. This ensures that a session-specific event, such as updating a hit counter in a database, is occurring each time a session begins or ends. 2. Using Application State o Application-level state is the top level in the state management hierarchy. The first time someone accesses your Web site, the Application object for the site is created. The Application object is alive until the server is rebooted, IIS is restarted, or a new copy of the Web site is deployed. In the

17 Object-Oriented Programming Global.asax file, there are Application_OnStart and Application_OnEnd events that you can write code to respond to; they're similar to the Session_OnStart and Session_OnEnd events. The difference is that applicationlevel variables are global for all sessions for your Web site, not for individual users. What Are XML Web Services? XML Web services are application components that can expose functionality over hypertext transfer protocol (HTTP) using the simple object access protocol (SOAP). Using Web services, you have the ability to expose methods in your applications to anyone on the Internet. Web services description language (WSDL) is an XML-based contract that defines what methods are contained in a Web service. DISCO, or discovery, files provide a mechanism to discover what Web services are available at a particular site. If you have a Web site and you want to expose a number of Web services, you can create a DISCO file that can be queried by others to find out what your site offers. Discovery files aren't required to make a Web service work; they just provide a mechanism to find out what's available on a specific Web site. Universal description, discovery, and integration (UDDI) is a distributed repository for Web services. The global community of the Internet needed a mechanism for people to find what Web services are available. You can go to and search for Web services by type, functionality, industry, or company. 257

18 Chapter 9 Active Server Pages ( ASP.NET) Creating Your First Web Service From this point, you can modify properties, add items from the toolbox, or switch to the Code view. If you look at the Properties window for this new Web service, you'll notice the name isn't firstservice, it's Service1. Service1 is the default name for all new Web services added to a project. When you created the project firstservice, you created the Internet Information Server (IIS) virtual directory named firstservice to contain the Web service named Service1. For now, you can leave the name Service1 as it is. On the designer, click the link that switches you to Code view. 258

19 Object-Oriented Programming Figure :The Code view of an XML Web service. You're now in the code-behind file for the Web service named Service1. Web services in Visual Studio.NET have a.asmx extension, so naturally the code-behind would be either ASMX.VB (for Visual Basic.NET) or ASMX.CS (for C#). It follows the same pattern as ASPX pages in Web applications. The code-behind file simply tacks on the language extension to the designer file. If you look at the code in the class file, you'll notice that the System.Web.Services namespace is imported into this class. 259

20 Chapter 9 Active Server Pages ( ASP.NET) Classes of the System.Web.Services Namespace Class Description WebMethodAttribute Adding this attribute to a method within an XML Web service created using ASP.NET makes the method callable from remote Web clients WebService The optional base class for XML Web services, which provides direct access to common ASP.NET objects, such as application and session state WebServiceAttribute Used to add additional information to an XML Web service. WebService BindingAttribute Declares the binding one or more XML Web service methods implemented within the class implementing the XML Web service Simply importing the System.Web.Services namespace doesn't make this a Web service. The class file must inherit the WebService class. So, in the Service1.asmx file, the following code makes this class a Web service: Imports System.Web.Services <WebService(Namespace := " Public Class Service1 Inherits System.Web.Services.WebService using System.Web.Services; namespace firstservice_cs { public class Service1 : System.Web.Services.WebService 260

21 Object-Oriented Programming All this is done automatically by Visual Studio.NET when you create a new Web service project or you add an ASMX file to your application. The Namespace attribute points to This is the default namespace for all new Web services created with Visual Studio.NET. You should change it before you deploy your Web service application. The namespace defines what data is in the Web service and what rules the data should follow. It's the same concept that you learned about yesterday when you created XML schema definition (XSD) files for the XML files in your project. In that case, the namespace defined what the XML should look like; the namespace for a Web service defines what the Web service should look like. Notice the commented-out HelloWorld method in the Service1 class. This sample method is in every new ASMX file in Visual Studio.NET. The HelloWorld method looks like any other method in the class files you worked with until today, with the exception of the WebMethod attribute. By prefixing a method name with the WebMethod attribute, it becomes available to the outside world. Note Attributes are tags that enable you to further define objects in an application. The attribute information is then examined at runtime through reflection, letting the language-specific compiler determine what to do with the attribute information. In the case of the WebMethod attribute, the ASP.NET engine knows to make the method available to remote callers. In C#, attributes are enclosed in brackets, [attributename], and in Visual Basic.NET, they're enclosed by less-than/greater-than signs, <attributename>. To make the HelloWorld method available to the outside world, uncomment the method. Make sure that you also uncomment the WebMethod attribute. Before you run the application, you must add two more methods that you'll consume later it'll also give you an idea of how to use Web services in a real-world scenario. 261

22 Chapter 9 Active Server Pages ( ASP.NET) Listing has two methods: GetCustomers and GetCustomerByID. Both use ADO.NET that you learned about over the past few days. Add these methods to the class file for Service1.asmx. <WebMethod()> Public Function GetCustomers() As DataSet Dim cn As New SqlConnection( "Server=jb1gs\NetSDK;Database=pubs;" _ & "Integrated Security=SSPI") Dim da As SqlDataAdapter = New SqlDataAdapter ("SELECT * from Authors", cn) Dim ds As DataSet = New DataSet() da.fill(ds, "Customers") Return ds End Function <WebMethod()> Public Function GetCustomerByID (ByVal ID As String) As DataSet Dim cn As New SqlConnection( "Server=jb1gs\NetSDK;Database=pubs;" _ & "Integrated Security=SSPI") Dim da As SqlDataAdapter = New SqlDataAdapter _ ("SELECT * from Authors where au_id =?", cn) da.selectcommand.parameters.add("au_id", ID) Dim ds As DataSet = New DataSet() da.fill(ds, "Customers") Return ds End Function 262

23 Object-Oriented Programming [WebMethod] public DataSet GetCustomers() { SqlConnection cn = new SqlConnection (@"Server=jb1gs\NetSDK;Database=Northwind;Integrated Security=SSPI"); SqlDataAdapter da = new SqlDataAdapter("SELECT * from Customers", cn); DataSet ds = new DataSet(); da.fill(ds, "Customers"); return ds; } [WebMethod] public DataSet GetCustomerByID(string ID) { SqlConnection cn = new SqlConnection (@"Server=jb1gs\NetSDK;Database=Northwind;Integrated Security=SSPI"); SqlDataAdapter da = new SqlDataAdapter (@"SELECT * from Customers where CustomerID cn); da.selectcommand.parameters.add("@customerid", SqlDbType.VarChar, 15).Value = ID; } DataSet ds = new DataSet(); da.fill(ds, "Customers"); return ds; 263

24 Chapter 9 Active Server Pages ( ASP.NET) Note The HTTP-POST and SOAP protocols are enabled by default, but not the HTTP-GET protocol. This was done for security reasons. To enable HTTP-GET for your Web Services, and to successfully do the exercises today, you need to modify the Web.Config file to allow the HTTP-GET protocol to be used. To do this, open the Web.Config file, and add the following section to after the <globalization> tag at the end of the Web.Config file: <webservices> <protocols> <add name="httpget"/> </protocols> </webservices> You can also enable and disable specific protocols in the machine.config file, which will affect all projects for an entire machine. To learn more about the configuration files, and how they can affect your applications, look up Configuration Options under XML Web Services in the Dynamic Help file. Press F5 to run the application. The browser now opens with the auto-generated Service Help Page, as shown in next figure. 264

25 Object-Oriented Programming Figure. Service Help page for a Web service. The Service Help Page provides you with a list of all the methods that are available in the Web service and some sample code that shows the implementation of the Web service in C# and Visual Basic.NET. Any time you reference an ASMX file without any parameters, you get the Service Help Page. Notice that the three methods you added to the class file are listed. If you didn't include the WebMethod attribute in one of the method declarations, you won't see it in the list. The URL that the browser is pointing to is simply the name of the server, the project name, and then the ASMX filename. If you click the GetCustomerByID link, you're taken to the Service Description page. The Service Description page gives you the WSDL grammar of how to access this method via SOAP, HTTP- GET, or HTTP-POST. That's a nice feature, but you really don't need to know any of that if you're using Visual Studio.NET to consume the Web service. Figure is what the Service Help page looks like for the GetCustomerByID method. 265

26 Chapter 9 Active Server Pages ( ASP.NET) Figure. The Service Help page. Notice that because the method accepts a parameter, you're given a text box to fill in the CustomerID parameter. If your Web service methods accept parameters, there will be a text box for each parameter. This is a great feature that makes it very easy to test your methods before you deploy your Web services. For the CustomerID method, type in ALFKI. Now, you can click the Invoke button to actually run the GetCustomerID method. The results are an XML file that's returned through the browser, as next Figure demonstrates. 266

27 Object-Oriented Programming Figure XML returned from the HelloWorld Web service. Notice that the URL has the name of the ASMX file and then the method name you're trying to call: This is the standard syntax to reference a method in a Web service. If the method expects parameters, you use the same query string syntax that you use for any URL that expects parameters. As an example, the following code assumes that a parameter named ID and a parameter named ZipCode are being passed to the HelloWorld method: ZipCode=33486 The next step is to consume the Web service from a client application and do something useful with the XML that's returned. 267

28 Chapter 9 Active Server Pages ( ASP.NET) Consuming XML Web Services Every time we come upon XML in this book, I mention that you don't have to know about XML to get anything done with XML. That still holds true. Although an XML Web service returns XML, the controls, classes, and tools in Visual Studio.NET natively read and write XML, so you don't need to understand the XML part you only need to understand how to get the data from the XML part. There are probably 50 ways to consume a Web service from any number of client applications. You can use Visual Basic 3, Visual Basic 4, Visual Basic 5, Visual Basic 6, Delphi, FLASH, C++, PowerBuilder you name it. Because the implementation simply returns text in XML format, anything that can read text can consume a Web service. That's the whole point of a Web service: It can be created and consumed by anything. The rest of the day focuses on four ways to consume a Web service, which I think are 99.9% of what you'll ever run into. You learn how to consume a Web service from An ASP.NET application A Windows Forms application A console application An HTML page from client-side VBScript/JavaScript Consuming a Web Service from an ASP.NET Application The idea behind a Web service is to be able to access application components from any type of application anywhere. To see how this works, you're going to create a new ASP.NET Web application and call the three methods of the firstservice application you just finished creating. To start, open a new instance of Visual Studio.NET and create a new ASP.NET Web application named firstservicewebconsumer in either Visual Basic.NET or C#, whichever language you prefer (see next Figure ). Click the OK button to create your new project. 268

29 Object-Oriented Programming Figure Creating the Web service Web consumer. After the project is created, you must reference the Web service you created earlier. This is accomplished in a similar manner to adding a reference to an assembly. If you right-click the References node on the Solution Explorer, you have two options: Add Reference and Add Web Reference, as next Figure demonstrates. Select Add Web Reference from the contextual menu. 269

30 Chapter 9 Active Server Pages ( ASP.NET) Figure The Add Reference option in the Solution Explorer. Figure The Add Web Reference dialog box. 270

31 Object-Oriented Programming The Add Web Reference dialog has several features. You can search the UDDI directory that was discussed earlier today. You can also search the Test Microsoft UDDI Directory. Microsoft has several Web services, such as the Knowledge Base search service, that you can test and implement in your own applications. Because you don't want to do either of the available options, you must type the URL of the Web service you want to consume. In the Address box, type or depending on what you named your project earlier. After you type in the address and press Enter, you should see something similar, which is the Service Help Page for the Web service named Service1.asmx. Figure Service Help page for Service1.asmx. 271

32 Chapter 9 Active Server Pages ( ASP.NET) From here, you have the same capabilities that you did when you ran the Web service from the project earlier. You can view the service descriptions, invoke the Web services, and inspect additional information that you might need about implementing the Web service. To add this reference to your project, click the Add Reference button. Your Solution Explorer should now look like:. Figure Solution after adding a Web reference for Service1.asmx. Tip When you add the Web reference, the Web server name where the Web service is located shows up in the Solution Explorer under Web References. You can right-click on the name of the Web server (in this case, localhost) and change it to something more familiar or recognizable. 272

33 Object-Oriented Programming Now that you've added the Web reference, you can reference the methods in the Web service as you would any other method in a class. Remember that the WSDL file can be considered a type library for a Web service. In.NET, the term proxy is to refer to the metadata of an object, but not necessarily the object itself. When you add a reference to a Web service created in.net, a WSDL proxy is added to your solution. The WSDL file contains all the type information that your application needs to invoke the Web service. For this exercise, the Web service and consumer are on the same machine. This might or might not be true in real life. Either way, you should always use the actual DNS name or IP address of the Web service when you add it through the Add Web Reference dialog. That way, if you move the consumer to another machine, the Web Reference is still valid. To access the methods in the newly added Web reference, follow these steps to prepare the default WebForm1.aspx page. The outcome should look familar. 1. Drag a Label control onto the form and set the Text property to Customer ID. 2. Drag a TextBox control to the right of the Label control and change its Name property to CustomerID. 3. Drag a CommandButton control to the form, change its Name property to GetCustomer and change the Text property to Get Customer. 4. Drag a CommandButton control to the form, change its Name property to GetCustomers, and change the Text property to Get Customers. 5. Drag a DataGrid control to the form. You can right-click the DataGrid and select AutoFormat from the contextual menu to select a nice color scheme. 273

34 Chapter 9 Active Server Pages ( ASP.NET) Figure Webform1 after adding new controls. Now that you've added the controls and the form is all set, doubleclick the Get Customer button to get to the code-behind for the GetCustomer click event. In Listing, you take the CustomerID information from the CustomerID TextBox and pass it to the GetCustomer method of the Web service. private void GetCustomer_Click(object sende,system.eventargs e) { localhost.service1 ws = new localhost.service1(); DataGrid1.DataSource = ws.getcustomerbyid(customerid.text.trim().tostring()); DataGrid1.DataBind(); } 274

35 Object-Oriented Programming The code is amazingly simple. All you need to do is create an instance of the Web service reference, and then call the method on the reference like any other class. Because the DataGrid control natively reads a DataSet and data returned from an XML Web service is read as either XML or a DataSet, you can just set the DataSource property of the DataGrid to the return value of the Web service, and the DataGrid understands the return value. After you set the DataSource of the DataGrid, you can call the DataBind method of the DataGrid and the data appears in the grid. Listing the code you should add to the GetCustomers click event, which returns all the customers in the Customers table. private void GetCustomer_Click(object sende,system.eventargs e) { localhost.service1 ws = new localhost.service1(); } DataGrid1.DataSource = ws.getcustomers(); DataGrid1.DataBind(); Now that you've written the code for both Click events, you can press F5 to run the application. When WebForm1 is in the browser, click the Get Customers button. Your results should look like next Figure. 275

36 Chapter 9 Active Server Pages ( ASP.NET) Figure Results of the GetCustomers method. Next, enter the CustomerID ALFKI into the TextBox control and click Get Customer. You should see something similar to next Figure. 276

37 Object-Oriented Programming Figure Results of the GetCustomer method. Just like that, you've consumed data from a Web service. You've also seen how to pass a variable to a method in a Web service. It's no different than working with any other object, except that methods can be called on a remote server and data is retrieved with no special settings on your part. It's truly a powerful tool. If you don't want to simply bind the data to a DataGrid, you can save the data to a file, load it into a stream, or bind it to other controls. Consuming an XML Web Service from a Windows Form Consuming a Web service from a Windows Forms application is identical to consuming a Web service from an ASP.NET Web application. You need to add a Web reference to the project, create an instance of the proxy class, and call the methods that you need to consume. 277

38 Chapter 9 Active Server Pages ( ASP.NET) To test this, create a new Windows Forms application and name it firstserviceformsconsumer_vb or firstserviceformsconsumer_cs, depending on the language you're coding in. When the project is loaded, add a ComboBox and a RichTextBox to the default form1. Change the Name property of the ComboBox to cbo, and change the Name property of the RichTextBox to rtb. Next, add the Web reference to the project exactly as you did for the ASP.NET Web application. Right-click the References node in the Solution Explorer, select Add Web Reference from the contextual menu, and enter the URL to the ASMX file. When that's done, you can write some code to consume the Web service. You're going to load the return data from the Web service into a DataSet, and then bind the DataSet to the ComboBox. On the SelectedIndexChanged event of the ComboBox, you'll call the GetCustomerByID Web service, and pass the Text property of the ComboBox to the method. Listing shows the code you should add to both the Form_Load event and the SelectedIndexChanged event of the ComboBox. private void Form1_Load(object sender, System.EventArgs e) { localhost.service1 ws = new localhost.service1(); DataSet ds = ws.getcustomers(); cbo.displaymember = "CustomerID"; cbo.datasource = ds.tables[0]; } private void combobox1_selectedindexchanged(object sender, System.EventArgs e) { localhost.service1 ws = new localhost.service1(); DataSet ds = ws.getcustomerbyid(cbo.text); rtb.text = ds.getxml(); } 278

39 Object-Oriented Programming If you run the application by pressing the F5 key, the Form_Load event calls the Web service and grabs all the customers. The databinding used in the form load is the same code you used two days ago when you wrote the DataAccess application. Because the return type from the Web service is a DataSet, you can just set the DataSet equal to the data coming back from the Web service. After the ComboBox is bound, the SelectedIndexChanged event fires and the GetCustomerID method of the Web service proxy is invoked each time you select another item. The GetXml method that you learned about yesterday loads the XML string into the RichTextBox control. Figure Consuming the Web service from Windows Forms. Each time you select another CustomerID from the ComboBox, the XML changes. 279

40 Chapter 9 Active Server Pages ( ASP.NET) Because both methods from the Web service are returning a DataSet, you have the full power of the DataSet class at your fingertips. You can save the XML to a file, load the XML into an XMLDocument object, or use an XMLTextReader to read through the nodes. Everything you learned yesterday about working with XML can be applied to the results from an XML Web service. If the return type is a string, integer, or even a serialized class, you can handle it accordingly. If a client is non-.net, the data is just XML, so it can be treated like an XML file. 280

Chapter 9. Web Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Chapter 9. Web Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Chapter 9 Web Applications McGraw-Hill 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter Objectives - 1 Explain the functions of the server and the client in Web programming Create a Web

More information

M Developing Microsoft ASP.NET Web Applications Using Visual Studio.NET 5 Day Course

M Developing Microsoft ASP.NET Web Applications Using Visual Studio.NET 5 Day Course Module 1: Overview of the Microsoft.NET Framework This module introduces the conceptual framework of the.net Framework and ASP.NET. Introduction to the.net Framework Overview of ASP.NET Overview of the

More information

Instructions for writing Web Services using Microsoft.NET:

Instructions for writing Web Services using Microsoft.NET: Instructions for writing Web Services using Microsoft.NET: Pre-requisites: Operating System: Microsoft Windows XP Professional / Microsoft Windows 2000 Professional / Microsoft Windows 2003 Server.NET

More information

Course ID: 2310C Course Name: Developing Web Applications Using Microsoft Visual Studio 2008

Course ID: 2310C Course Name: Developing Web Applications Using Microsoft Visual Studio 2008 Course ID: 2310C Course Name: Developing Web Applications Using Microsoft Visual Studio 2008 Audience This course is intended for introductory-level Web developers who have knowledge of Hypertext Markup

More information

2310C VB - Developing Web Applications Using Microsoft Visual Studio 2008 Course Number: 2310C Course Length: 5 Days

2310C VB - Developing Web Applications Using Microsoft Visual Studio 2008 Course Number: 2310C Course Length: 5 Days 2310C VB - Developing Web Applications Using Microsoft Visual Studio 2008 Course Number: 2310C Course Length: 5 Days Certification Exam This course will help you prepare for the following Microsoft Certified

More information

CST272 Getting Started Page 1

CST272 Getting Started Page 1 CST272 Getting Started Page 1 1 2 3 4 5 6 8 Introduction to ASP.NET, Visual Studio and C# CST272 ASP.NET Static and Dynamic Web Applications Static Web pages Created with HTML controls renders exactly

More information

.NET FRAMEWORK. Visual C#.Net

.NET FRAMEWORK. Visual C#.Net .NET FRAMEWORK Intro to.net Platform for the.net Drawbacks of Current Trend Advantages/Disadvantages of Before.Net Features of.net.net Framework Net Framework BCL & CLR, CTS, MSIL, & Other Tools Security

More information

.NET, C#, and ASP.NET p. 1 What Is.NET? p. 2 The Common Language Runtime p. 2 Introducing C# p. 3 Introducing ASP.NET p. 4 Getting Started p.

.NET, C#, and ASP.NET p. 1 What Is.NET? p. 2 The Common Language Runtime p. 2 Introducing C# p. 3 Introducing ASP.NET p. 4 Getting Started p. Introduction p. xix.net, C#, and ASP.NET p. 1 What Is.NET? p. 2 The Common Language Runtime p. 2 Introducing C# p. 3 Introducing ASP.NET p. 4 Getting Started p. 5 Installing Internet Information Server

More information

Assembling a Three-Tier Web Form Application

Assembling a Three-Tier Web Form Application Chapter 16 Objectives Assembling a Three-Tier Application In this chapter, you will: Understand the concept of state for Web applications Create an ASP.NET user control Use data binding technology Develop

More information

DOT NET Syllabus (6 Months)

DOT NET Syllabus (6 Months) DOT NET Syllabus (6 Months) THE COMMON LANGUAGE RUNTIME (C.L.R.) CLR Architecture and Services The.Net Intermediate Language (IL) Just- In- Time Compilation and CLS Disassembling.Net Application to IL

More information

Developing Web Applications Using Microsoft Visual Studio 2008 SP1

Developing Web Applications Using Microsoft Visual Studio 2008 SP1 Developing Web s Using Microsoft Visual Studio 2008 SP1 Introduction This five day instructor led course provides knowledge and skills on developing Web applications by using Microsoft Visual Studio 2008

More information

ITdumpsFree. Get free valid exam dumps and pass your exam test with confidence

ITdumpsFree.  Get free valid exam dumps and pass your exam test with confidence ITdumpsFree http://www.itdumpsfree.com Get free valid exam dumps and pass your exam test with confidence Exam : 070-305 Title : Developing and Implementing Web Applications with Microsoft Visual Basic.NET

More information

COPYRIGHTED MATERIAL. Contents. Chapter 1: Introducing Microsoft Expression Web 1. Chapter 2: Building a Web Page 21. Acknowledgments Introduction

COPYRIGHTED MATERIAL. Contents. Chapter 1: Introducing Microsoft Expression Web 1. Chapter 2: Building a Web Page 21. Acknowledgments Introduction Acknowledgments Introduction Chapter 1: Introducing Microsoft Expression Web 1 Familiarizing Yourself with the Interface 2 The Menu Bar 5 The Development Window 7 The Development Area 8 The Tabbed File

More information

Accessing Data in ASP.NET

Accessing Data in ASP.NET Chapter 8 Accessing Data in ASP.NET We have provided a very detailed discussion on database programming with Visual C#.NET using the Windows - based applications in the previous chapters. Starting with

More information

ASP.NET 2.0 p. 1.NET Framework 2.0 p. 2 ASP.NET 2.0 p. 4 New Features p. 5 Special Folders Make Integration Easier p. 5 Security p.

ASP.NET 2.0 p. 1.NET Framework 2.0 p. 2 ASP.NET 2.0 p. 4 New Features p. 5 Special Folders Make Integration Easier p. 5 Security p. Preface p. xix ASP.NET 2.0 p. 1.NET Framework 2.0 p. 2 ASP.NET 2.0 p. 4 New Features p. 5 Special Folders Make Integration Easier p. 5 Security p. 6 Personalization p. 6 Master Pages p. 6 Navigation p.

More information

Developing Web Applications Using Microsoft Visual Studio 2008

Developing Web Applications Using Microsoft Visual Studio 2008 Course 2310C: Developing Web Applications Using Microsoft Visual Studio 2008 Length: 5 Day(s) Published: April 24, 2008 Language(s): English Audience(s): Developers Level: 100 Technology: Microsoft Visual

More information

ASP.NET Training Course Duration. 30 Working days, daily one and half hours. ASP.NET Training Course Overview

ASP.NET Training Course Duration. 30 Working days, daily one and half hours. ASP.NET Training Course Overview ASP.NET Training Course Duration 30 Working days, daily one and half hours ASP.NET Training Course Overview Introduction To Web Applications [Prerequisites] Types of Applications Web, Desktop & Mobile

More information

Microsoft ASP.NET Using Visual Basic 2008: Volume 1 Table of Contents

Microsoft ASP.NET Using Visual Basic 2008: Volume 1 Table of Contents Table of Contents INTRODUCTION...INTRO-1 Prerequisites...INTRO-2 Installing the Practice Files...INTRO-3 Software Requirements...INTRO-3 Installation...INTRO-3 The Chapter Files...INTRO-3 Sample Database...INTRO-3

More information

10267A CS: Developing Web Applications Using Microsoft Visual Studio 2010

10267A CS: Developing Web Applications Using Microsoft Visual Studio 2010 10267A CS: Developing Web Applications Using Microsoft Visual Studio 2010 Course Overview This instructor-led course provides knowledge and skills on developing Web applications by using Microsoft Visual

More information

Getting Started with Web Services

Getting Started with Web Services Getting Started with Web Services Getting Started with Web Services A web service is a set of functions packaged into a single entity that is available to other systems on a network. The network can be

More information

DOT NET SYLLABUS FOR 6 MONTHS

DOT NET SYLLABUS FOR 6 MONTHS DOT NET SYLLABUS FOR 6 MONTHS INTRODUCTION TO.NET Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.) CLR Architecture and Services The.Net Intermediate

More information

Web-based Apps in.net

Web-based Apps in.net Web-based Apps in.net Objectives Real-world applications are typically multi-tier, distributed designs involving many components the web server being perhaps the most important component in today's applications...

More information

INTRODUCTION TO.NET. Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.)

INTRODUCTION TO.NET. Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.) INTRODUCTION TO.NET Domain of.net D.N.A. Architecture One Tier Two Tier Three Tier N-Tier THE COMMON LANGUAGE RUNTIME (C.L.R.) CLR Architecture and Services The.Net Intermediate Language (IL) Just- In-

More information

Web Platform Introduction With a focus on free. Mike Taulty Developer & Platform Group Microsoft Ltd

Web Platform Introduction With a focus on free. Mike Taulty Developer & Platform Group Microsoft Ltd Web Platform Introduction With a focus on free Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com http://www.mtaulty.com The humble web request Internet Information Services

More information

ASP.NET Web Forms Programming Using Visual Basic.NET

ASP.NET Web Forms Programming Using Visual Basic.NET ASP.NET Web Forms Programming Using Visual Basic.NET Duration: 35 hours Price: $750 Delivery Option: Attend training via an on-demand, self-paced platform paired with personal instructor facilitation.

More information

Getting Started with Web Services

Getting Started with Web Services Getting Started with Web Services Getting Started with Web Services A web service is a set of functions packaged into a single entity that is available to other systems on a network. The network can be

More information

SECURED PROGRAMMING IN.NET DETAILED TRAINING CONTENT INDUSTRIAL TRAINING PROGRAM ( )

SECURED PROGRAMMING IN.NET DETAILED TRAINING CONTENT INDUSTRIAL TRAINING PROGRAM ( ) SECURED PROGRAMMING IN.NET DETAILED TRAINING CONTENT INDUSTRIAL TRAINING PROGRAM (2013-2014) MODULE: C# PROGRAMMING CHAPTER 1: INTRODUCING.NET AND C# 1.1 INTRODUCTION TO LANGUAGES C++ C# DIFFERENCES BETWEEN

More information

CST272 Getting Started Page 1

CST272 Getting Started Page 1 CST272 Getting Started Page 1 1 2 3 5 6 8 10 Introduction to ASP.NET and C# CST272 ASP.NET ASP.NET Server Controls (Page 1) Server controls can be Buttons, TextBoxes, etc. In the source code, ASP.NET controls

More information

Building Web Sites Using the EPiServer Content Framework

Building Web Sites Using the EPiServer Content Framework Building Web Sites Using the EPiServer Content Framework Product version: 4.60 Document version: 1.0 Document creation date: 28-03-2006 Purpose A major part in the creation of a Web site using EPiServer

More information

Getting Started with the Bullhorn SOAP API and C#/.NET

Getting Started with the Bullhorn SOAP API and C#/.NET Getting Started with the Bullhorn SOAP API and C#/.NET Introduction This tutorial is for developers who develop custom applications that use the Bullhorn SOAP API and C#. You develop a sample application

More information

ALPHAPRIMETECH 112 New South Road, Hicksville, NY 11801

ALPHAPRIMETECH 112 New South Road, Hicksville, NY 11801 ALPHAPRIMETECH 112 New South Road, Hicksville, NY 11801 Course Curriculum COMPUTER SYSTEM ANALYST-.NET C# Introduction to.net Framework.NET Framework OverView CLR,CLS MSIL Assemblies NameSpaces.NET Languages

More information

EXAM Web Development Fundamentals. Buy Full Product.

EXAM Web Development Fundamentals. Buy Full Product. Microsoft EXAM - 98-363 Web Development Fundamentals Buy Full Product http://www.examskey.com/98-363.html Examskey Microsoft 98-363 exam demo product is here for you to test the quality of the product.

More information

Q&A. DEMO Version

Q&A. DEMO Version UPGRADE: MCSD Microsoft.NET Skills to MCPD Enterprise Application Developer: Part 2 Q&A DEMO Version Copyright (c) 2010 Chinatag LLC. All rights reserved. Important Note Please Read Carefully For demonstration

More information

Introduction to Web Development with Microsoft Visual Studio 2010

Introduction to Web Development with Microsoft Visual Studio 2010 Introduction to Web Development with Microsoft Visual Studio 2010 Course 10267; 5 Days, Instructor-led Course Description This five-day instructor-led course provides knowledge and skills on developing

More information

6 Months Training Module in.net Module 1-Total Days-20

6 Months Training Module in.net Module 1-Total Days-20 6 Months Training Module in.net Visual Studio Version: 2008.net Framework: 3.5 Database: SQL Server 2005 Module 1-Total Days-20 Introduction to.net framework: History of.net.net framework.net version Features/advantages

More information

C H A P T E R T W E N T Y E I G H T. Create, close, and open a Web application. Add an image, text box, label, and button to a Web page

C H A P T E R T W E N T Y E I G H T. Create, close, and open a Web application. Add an image, text box, label, and button to a Web page 28 GETTING WEB-IFIED After studying Chapter 28, you should be able to: Create, close, and open a Web application View a Web page in a browser window and full screen view Add static text to a Web page Add

More information

Book IX. Developing Applications Rapidly

Book IX. Developing Applications Rapidly Book IX Developing Applications Rapidly Contents at a Glance Chapter 1: Building Master and Detail Pages Chapter 2: Creating Search and Results Pages Chapter 3: Building Record Insert Pages Chapter 4:

More information

CaseComplete Roadmap

CaseComplete Roadmap CaseComplete Roadmap Copyright 2004-2014 Serlio Software Development Corporation Contents Get started... 1 Create a project... 1 Set the vision and scope... 1 Brainstorm for primary actors and their goals...

More information

ASP.net. Microsoft. Getting Started with. protected void Page_Load(object sender, EventArgs e) { productsdatatable = new DataTable();

ASP.net. Microsoft. Getting Started with. protected void Page_Load(object sender, EventArgs e) { productsdatatable = new DataTable(); Getting Started with protected void Page_Load(object sender, EventArgs e) { productsdatatable = new DataTable(); string connectionstring = System.Configuration.ConfigurationManager.ConnectionStrings ["default"].connectionstring;!

More information

Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet

Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet 1. Macros 1.1 What is a macro? A macro is a set of one or more actions

More information

Introduction to Web Development with Microsoft Visual Studio 2010

Introduction to Web Development with Microsoft Visual Studio 2010 10267 - Introduction to Web Development with Microsoft Visual Studio 2010 Duration: 5 days Course Price: $2,975 Software Assurance Eligible Course Description Course Overview This five-day instructor-led

More information

Working with Data in ASP.NET 2.0 :: Adding Validation Controls to the Editing and Inserting Interfaces Introduction

Working with Data in ASP.NET 2.0 :: Adding Validation Controls to the Editing and Inserting Interfaces Introduction This tutorial is part of a set. Find out more about data access with ASP.NET in the Working with Data in ASP.NET 2.0 section of the ASP.NET site at http://www.asp.net/learn/dataaccess/default.aspx. Working

More information

Mastering VB.NET using Visual Studio 2010 Course Length: 5 days Price: $2,500

Mastering VB.NET using Visual Studio 2010 Course Length: 5 days Price: $2,500 Mastering VB.NET using Visual Studio 2010 Course Length: 5 days Price: $2,500 Summary Each day there will be a combination of presentations, code walk-throughs, and handson projects. The final project

More information

Naresh Information Technologies

Naresh Information Technologies Naresh Information Technologies Server-side technology ASP.NET Web Forms & Web Services Windows Form: Windows User Interface ADO.NET: Data & XML.NET Framework Base Class Library Common Language Runtime

More information

DE-2310 Developing Web Applications Using Microsoft Visual Studio 2008 SP1

DE-2310 Developing Web Applications Using Microsoft Visual Studio 2008 SP1 DE-2310 Developing Web Applications Using Microsoft Visual Studio 2008 SP1 Summary Duration 5 Days Audience Developers Level 100 Technology Microsoft Visual Studio 2008 Delivery Method Instructor-led (Classroom)

More information

Module 7: Building Web Applications

Module 7: Building Web Applications Module 7: Building Web Applications Contents Overview 1 Introduction to ASP.NET 2 Creating Web Form Applications 16 Demonstration: Creating Web Forms 30 Lab 7.1: Creating the Customer Logon Web Forms 31

More information

COURSE OUTLINE: OD10267A Introduction to Web Development with Microsoft Visual Studio 2010

COURSE OUTLINE: OD10267A Introduction to Web Development with Microsoft Visual Studio 2010 Course Name OD10267A Introduction to Web Development with Microsoft Visual Studio 2010 Course Duration 2 Days Course Structure Online Course Overview This course provides knowledge and skills on developing

More information

You can use Dreamweaver to build master and detail Web pages, which

You can use Dreamweaver to build master and detail Web pages, which Chapter 1: Building Master and Detail Pages In This Chapter Developing master and detail pages at the same time Building your master and detail pages separately Putting together master and detail pages

More information

OUTLINE DELPHI 2005 FOR.NET JUMP START

OUTLINE DELPHI 2005 FOR.NET JUMP START JENSEN DATA SYSTEMS, INC. pg 1 OUTLINE DELPHI 2005 FOR.NET JUMP START CARY JENSEN, PH.D. COPYRIGHT 2003-2005. CARY JENSEN. JENSEN DATA SYSTEMS, INC. ALL RIGHTS RESERVED. JENSEN DATA SYSTEMS, INC. HTTP://WWW.JENSENDATASYSTEMS.COM

More information

"Charting the Course... MOC A Introduction to Web Development with Microsoft Visual Studio Course Summary

Charting the Course... MOC A Introduction to Web Development with Microsoft Visual Studio Course Summary Description Course Summary This course provides knowledge and skills on developing Web applications by using Microsoft Visual. Objectives At the end of this course, students will be Explore ASP.NET Web

More information

DE Introduction to Web Development with Microsoft Visual Studio 2010

DE Introduction to Web Development with Microsoft Visual Studio 2010 DE-10267 Introduction to Web Development with Microsoft Visual Studio 2010 Summary Duration 5 Days Audience Developers Level 100 Technology Microsoft Visual Studio 2010 Delivery Method Instructor-led (Classroom)

More information

ADO.NET 2.0. database programming with

ADO.NET 2.0. database programming with TRAINING & REFERENCE murach s ADO.NET 2.0 database programming with (Chapter 3) VB 2005 Thanks for downloading this chapter from Murach s ADO.NET 2.0 Database Programming with VB 2005. We hope it will

More information

2609 : Introduction to C# Programming with Microsoft.NET

2609 : Introduction to C# Programming with Microsoft.NET 2609 : Introduction to C# Programming with Microsoft.NET Introduction In this five-day instructor-led course, developers learn the fundamental skills that are required to design and develop object-oriented

More information

10267 Introduction to Web Development with Microsoft Visual Studio 2010

10267 Introduction to Web Development with Microsoft Visual Studio 2010 10267 Introduction to Web Development with Microsoft Visual Studio 2010 Course Number: 10267A Category: Visual Studio 2010 Duration: 5 days Course Description This five-day instructor-led course provides

More information

How to use data sources with databases (part 1)

How to use data sources with databases (part 1) Chapter 14 How to use data sources with databases (part 1) 423 14 How to use data sources with databases (part 1) Visual Studio 2005 makes it easier than ever to generate Windows forms that work with data

More information

M Introduction to C# Programming with Microsoft.NET - 5 Day Course

M Introduction to C# Programming with Microsoft.NET - 5 Day Course Module 1: Getting Started This module presents the concepts that are central to the Microsoft.NET Framework and platform, and the Microsoft Visual Studio.NET integrated development environment (IDE); describes

More information

Introduction to using Microsoft Expression Web to build data-aware web applications

Introduction to using Microsoft Expression Web to build data-aware web applications CT5805701 Software Engineering in Construction Information System Dept. of Construction Engineering, Taiwan Tech Introduction to using Microsoft Expression Web to build data-aware web applications Yo Ming

More information

Apex TG India Pvt. Ltd.

Apex TG India Pvt. Ltd. (Core C# Programming Constructs) Introduction of.net Framework 4.5 FEATURES OF DOTNET 4.5 CLR,CLS,CTS, MSIL COMPILER WITH TYPES ASSEMBLY WITH TYPES Basic Concepts DECISION CONSTRUCTS LOOPING SWITCH OPERATOR

More information

Preparing Students for MTA Certification MICROSOFT TECHNOLOGY ASSOCIATE. Exam Review Labs. EXAM Web Development Fundamentals

Preparing Students for MTA Certification MICROSOFT TECHNOLOGY ASSOCIATE. Exam Review Labs. EXAM Web Development Fundamentals Preparing Students for MTA Certification MICROSOFT TECHNOLOGY ASSOCIATE Exam Review Labs EXAM 98-363 Web Development Fundamentals TABLE OF CONTENTS Student Activity 1.1... 2 Student Activity 1.2... 3 Student

More information

ASP.NET State Management Techniques

ASP.NET State Management Techniques ASP.NET State Management Techniques This article is for complete beginners who are new to ASP.NET and want to get some good knowledge about ASP.NET State Management. What is the need of State Management?

More information

Introduction to ASP.NET

Introduction to ASP.NET Introduction to ASP.NET 1 ASP.NET ASP.NET is a managed framework that facilitates building server-side applications based on HTTP, HTML, XML and SOAP. To.NET developers, ASP.NET is a platform that provides

More information

Web Service Elements. Element Specifications for Cisco Unified CVP VXML Server and Cisco Unified Call Studio Release 10.0(1) 1

Web Service Elements. Element Specifications for Cisco Unified CVP VXML Server and Cisco Unified Call Studio Release 10.0(1) 1 Along with Action and Decision elements, another way to perform backend interactions and obtain real-time data is via the Web Service element. This element leverages industry standards, such as the Web

More information

Using ASP.NET Code-Behind Without Visual Studio.NET

Using ASP.NET Code-Behind Without Visual Studio.NET Pá gina 1 de 8 QUICK TIP: Using " in your Strings Using ASP.NET Code-Behind Without Visual Studio.NET Home News Samples Forum * Articles Resources Lessons Links Search Please visit our Partners by John

More information

Pace University. Web Service Workshop Lab Manual

Pace University. Web Service Workshop Lab Manual Pace University Web Service Workshop Lab Manual Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University July 12, 2005 Table of Contents 1 1 Lab objectives... 1 2 Lab design...

More information

Migrating from ASP to ASP.NET

Migrating from ASP to ASP.NET Migrating from ASP to ASP.NET Leveraging ASP.NET Server Controls Dan Wahlin Wahlin Consulting LLC http://www.xmlforasp.net Summary: Converting ASP web applications to ASP.NET can prove to be a timeconsuming

More information

Coveo Platform 7.0. Microsoft Dynamics CRM Connector Guide

Coveo Platform 7.0. Microsoft Dynamics CRM Connector Guide Coveo Platform 7.0 Microsoft Dynamics CRM Connector Guide Notice The content in this document represents the current view of Coveo as of the date of publication. Because Coveo continually responds to changing

More information

Validations. Today You Will Learn. Understanding Validation The Validation Controls. CSE 409 Advanced Internet Technology

Validations. Today You Will Learn. Understanding Validation The Validation Controls. CSE 409 Advanced Internet Technology Validations Today You Will Learn Understanding Validation CSE 409 Advanced Internet Technology Understanding Validation What s particularly daunting is the range of possible mistakes that users can make.

More information

.NET-6Weeks Project Based Training

.NET-6Weeks Project Based Training .NET-6Weeks Project Based Training Core Topics 1. C# 2. MS.Net 3. ASP.NET 4. 1 Project MS.NET MS.NET Framework The.NET Framework - an Overview Architecture of.net Framework Types of Applications which

More information

การสร างเว บเซอร ว สโดยใช Microsoft.NET

การสร างเว บเซอร ว สโดยใช Microsoft.NET การสร างเว บเซอร ว สโดยใช Microsoft.NET อ.ดร. กานดา ร ณนะพงศา ภาคว ชาว ศวกรรมคอมพ วเตอร คณะว ศวกรรมคอมพ วเตอร มหาว ทยาล ยขอนแก น บทน า.NET เป นเคร องม อท เราสามารถน ามาใช ในการสร างและเร ยกเว บเซอร ว สได

More information

CS708 Lecture Notes. Visual Basic.NET Object-Oriented Programming. Implementing Client/Server Architectures. Part (I of?) (Lecture Notes 5A)

CS708 Lecture Notes. Visual Basic.NET Object-Oriented Programming. Implementing Client/Server Architectures. Part (I of?) (Lecture Notes 5A) CS708 Lecture Notes Visual Basic.NET Object-Oriented Programming Implementing Client/Server Architectures Part (I of?) (Lecture Notes 5A) Professor: A. Rodriguez CHAPTER 1 IMPLEMENTING CLIENT/SERVER APPLICATIONS...

More information

BEGINNER PHP Table of Contents

BEGINNER PHP Table of Contents Table of Contents 4 5 6 7 8 9 0 Introduction Getting Setup Your first PHP webpage Working with text Talking to the user Comparison & If statements If & Else Cleaning up the game Remembering values Finishing

More information

Microsoft Exam Questions & Answers

Microsoft Exam Questions & Answers Microsoft 98-363 Exam Questions & Answers Number: 98-363 Passing Score: 800 Time Limit: 120 min File Version: 20.3 http://www.gratisexam.com/ Microsoft 98-363 Exam Questions & Answers Exam Name: Web Development

More information

PracticeDump. Free Practice Dumps - Unlimited Free Access of practice exam

PracticeDump.  Free Practice Dumps - Unlimited Free Access of practice exam PracticeDump http://www.practicedump.com Free Practice Dumps - Unlimited Free Access of practice exam Exam : 070-315 Title : Developing and Implementing Web Applications with Microsoft Visual Csharp.NET

More information

Getting Help...71 Getting help with ScreenSteps...72

Getting Help...71 Getting help with ScreenSteps...72 GETTING STARTED Table of Contents Onboarding Guides... 3 Evaluating ScreenSteps--Welcome... 4 Evaluating ScreenSteps--Part 1: Create 3 Manuals... 6 Evaluating ScreenSteps--Part 2: Customize Your Knowledge

More information

3-tier Architecture Step by step Exercises Hans-Petter Halvorsen

3-tier Architecture Step by step Exercises Hans-Petter Halvorsen https://www.halvorsen.blog 3-tier Architecture Step by step Exercises Hans-Petter Halvorsen Software Architecture 3-Tier: A way to structure your code into logical parts. Different devices or software

More information

Getting Started with EPiServer 4

Getting Started with EPiServer 4 Getting Started with EPiServer 4 Abstract This white paper includes information on how to get started developing EPiServer 4. The document includes, among other things, high-level installation instructions,

More information

ASP.NET Pearson Education, Inc. All rights reserved.

ASP.NET Pearson Education, Inc. All rights reserved. 1 ASP.NET 2 Rule One: Our client is always right. Rule Two: If you think our client is wrong, see Rule One. Anonymous 3 25.1 Introduction ASP.NET 2.0 and Web Forms and Controls Web application development

More information

AC I Sem 5_TYCS. ASP.NET application codes can be written in any of the following languages:

AC I Sem 5_TYCS. ASP.NET application codes can be written in any of the following languages: Chapter 1-Overview of.net Framework What is ASP.NET? ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required to

More information

Developing an app using Web Services, DB2, and.net

Developing an app using Web Services, DB2, and.net Developing an app using Web Services, DB2, and.net http://www7b.software.ibm.com/dmdd/ Table of contents If you're viewing this document online, you can click any of the topics below to link directly to

More information

Microsoft ASP.NET Whole Course Syllabus upto Developer Module (Including all three module Primary.NET + Advance Course Techniques+ Developer Tricks)

Microsoft ASP.NET Whole Course Syllabus upto Developer Module (Including all three module Primary.NET + Advance Course Techniques+ Developer Tricks) Microsoft ASP.NET Whole Course Syllabus upto Developer Module (Including all three module Primary.NET + Advance Course Techniques+ Developer Tricks) Introduction of.net Framework CLR (Common Language Run

More information

Slide 1 CS 170 Java Programming 1 Testing Karel

Slide 1 CS 170 Java Programming 1 Testing Karel CS 170 Java Programming 1 Testing Karel Introducing Unit Tests to Karel's World Slide 1 CS 170 Java Programming 1 Testing Karel Hi Everybody. This is the CS 170, Java Programming 1 lecture, Testing Karel.

More information

Getting Started with EPiServer 4

Getting Started with EPiServer 4 Getting Started with EPiServer 4 Abstract This white paper includes information on how to get started developing EPiServer 4. The document includes, among other things, high-level installation instructions,

More information

Alfresco Content Services 5.2. Getting Started Guide

Alfresco Content Services 5.2. Getting Started Guide Alfresco Content Services 5.2 Getting Started Guide Contents Contents Getting started with Alfresco Share... 3 Signing in...3 Personalizing Alfresco Share... 4 Setting up your dashboard... 4 Updating your

More information

Advanced Programming Using Visual Basic 2008

Advanced Programming Using Visual Basic 2008 Chapter 6 Services Part 1 Introduction to Services Advanced Programming Using Visual Basic 2008 First There Were Web Services A class that can be compiled and stored on the Web for an application to use

More information

Le nouveau Morfik est arrivé (The new Morfik has arrived)

Le nouveau Morfik est arrivé (The new Morfik has arrived) Le nouveau Morfik est arrivé (The new Morfik has arrived) Michaël Van Canneyt April 7, 2008 Abstract Soon, it will be 2 years ago since the first review of Morfik in this magazine. When the current issue

More information

Simple sets of data can be expressed in a simple table, much like a

Simple sets of data can be expressed in a simple table, much like a Chapter 1: Building Master and Detail Pages In This Chapter Developing master and detail pages at the same time Building your master and detail pages separately Putting together master and detail pages

More information

XML Web Services Basics

XML Web Services Basics MSDN Home XML Web Services Basics Page Options Roger Wolter Microsoft Corporation December 2001 Summary: An overview of the value of XML Web services for developers, with introductions to SOAP, WSDL, and

More information

Skyway Builder 6.3 Reference

Skyway Builder 6.3 Reference Skyway Builder 6.3 Reference 6.3.0.0-07/21/09 Skyway Software Skyway Builder 6.3 Reference: 6.3.0.0-07/21/09 Skyway Software Published Copyright 2009 Skyway Software Abstract The most recent version of

More information

Audience: Experienced application developers or architects responsible for Web applications in a Microsoft environment.

Audience: Experienced application developers or architects responsible for Web applications in a Microsoft environment. ASP.NET Using C# (VS 2010) This five-day course provides a comprehensive and practical hands-on introduction to developing Web applications using ASP.NET 4.0 and C#. It includes an introduction to ASP.NET

More information

To get started with Visual Basic 2005, I recommend that you jump right in

To get started with Visual Basic 2005, I recommend that you jump right in In This Chapter Chapter 1 Wading into Visual Basic Seeing where VB fits in with.net Writing your first Visual Basic 2005 program Exploiting the newfound power of VB To get started with Visual Basic 2005,

More information

Tivoli Common Reporting V Cognos report in a Tivoli Integrated Portal dashboard

Tivoli Common Reporting V Cognos report in a Tivoli Integrated Portal dashboard Tivoli Common Reporting V2.1.1 Cognos report in a Tivoli Integrated Portal dashboard Preethi C Mohan IBM India Ltd. India Software Labs, Bangalore +91 80 40255077 preethi.mohan@in.ibm.com Copyright IBM

More information

CS708 Lecture Notes. Visual Basic.NET Programming. Object-Oriented Programming Web Technologies and ASP.NET. (Part I) (Lecture Notes 5B)

CS708 Lecture Notes. Visual Basic.NET Programming. Object-Oriented Programming Web Technologies and ASP.NET. (Part I) (Lecture Notes 5B) CS708 Lecture Notes Visual Basic.NET Programming Object-Oriented Programming Web Technologies and ASP.NET (Part I) (Lecture Notes 5B) Prof. Abel Angel Rodriguez SECTION I. INTRODUCTION TO WEB APPLICATIONS

More information

1.1 Customize the Layout and Appearance of a Web Page. 1.2 Understand ASP.NET Intrinsic Objects. 1.3 Understand State Information in Web Applications

1.1 Customize the Layout and Appearance of a Web Page. 1.2 Understand ASP.NET Intrinsic Objects. 1.3 Understand State Information in Web Applications LESSON 1 1.1 Customize the Layout and Appearance of a Web Page 1.2 Understand ASP.NET Intrinsic Objects 1.3 Understand State Information in Web Applications 1.4 Understand Events and Control Page Flow

More information

SQL Server. Management Studio. Chapter 3. In This Chapter. Management Studio. c Introduction to SQL Server

SQL Server. Management Studio. Chapter 3. In This Chapter. Management Studio. c Introduction to SQL Server Chapter 3 SQL Server Management Studio In This Chapter c Introduction to SQL Server Management Studio c Using SQL Server Management Studio with the Database Engine c Authoring Activities Using SQL Server

More information

Beginning ASP.NET. 4.5 in C# Matthew MacDonald

Beginning ASP.NET. 4.5 in C# Matthew MacDonald Beginning ASP.NET 4.5 in C# Matthew MacDonald Contents About the Author About the Technical Reviewers Acknowledgments Introduction xxvii xxix xxxi xxxiii UPart 1: Introducing.NET. 1 & Chapter 1: The Big

More information

3 Customer records. Chapter 3: Customer records 57

3 Customer records. Chapter 3: Customer records 57 Chapter 3: Customer records 57 3 Customer records In this program we will investigate how records in a database can be displayed on a web page, and how new records can be entered on a web page and uploaded

More information

Microsoft Official Courseware Course Introduction to Web Development with Microsoft Visual Studio

Microsoft Official Courseware Course Introduction to Web Development with Microsoft Visual Studio Course Overview: This five-day instructor-led course provides knowledge and skills on developing Web applications by using Microsoft Visual Studio 2010. Prerequisites Before attending this course, students

More information

Welcome Application. Introducing the Visual Studio.NET IDE. Objectives. Outline

Welcome Application. Introducing the Visual Studio.NET IDE. Objectives. Outline 2 T U T O R I A L Objectives In this tutorial, you will learn to: Navigate Visual Studio.NET s Start Page. Create a Visual Basic.NET solution. Use the IDE s menus and toolbars. Manipulate windows in the

More information

M Introduction to Visual Basic.NET Programming with Microsoft.NET 5 Day Course

M Introduction to Visual Basic.NET Programming with Microsoft.NET 5 Day Course Module 1: Getting Started This module introduces Visual Basic.NET and explains how it fits into the.net platform. It explains how to use the programming tools in Microsoft Visual Studio.NET and provides

More information

Chapter 10. Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Chapter 10. Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Chapter 10 Database Applications McGraw-Hill 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter Objectives Use database terminology correctly Create Windows and Web projects that display

More information