JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Writing HTML to a Web Form at Run Time

You can write HTML to a Web form at run time with the Write method of the ASP .NET Response object. For example, to write the <h1> header "Welcome to my page!" in a Web form at run time (not design time), place this line in the Page_Load event handler:

Response.Write("<h1>Welcome to my page!</h1>")

You can see this at work in the WriteHTML example on the CD-ROM, as you see in Figure 14.18.

Click To expand
Figure 14.18: Writing HTML at run time.
Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor