Using HTML Controls

Team Fly 

Page 287

image

FIGURE 11.5 Send generated graphics or any binary data directly to the client browser.

This technique is not for a typical web page that the user would simply surf to via hyperlink or such. Just use an Image control for that kind of graphic. Instead, this is a page that is a response to a user query, and it is dynamically generated—not some graphics file that you're sending or embedding in a web page. Use this technique to, for example, generate a histogram out of the sales figures stored in a database. This on-demand graph could be quite useful to the traveling salesmen in your company: they could see at a glance, on a real-time basis, their current status relative to their competition. This feature transmits binary data, so it's not limited to graphics. Indeed, I could send this Word .doc file.

Using HTML Controls

So far you've worked with WebControls in this chapter, but it's possible that in some situations you might want to resort to the old-style HTML controls located in a separate tab on the Toolbox. For most situations, the WebControls are preferable, if for no other reason than they permit you to easily integrate VB.NET via the code-behind process. Also, if you've ever tried to manage GUIs within HTML, you'll recall that it's confining, to say the least. All the HTML controls' functionality is available in equivalent, but usually more powerful and efficient, WebForm controls (WebControls). The only exception to this is the File Field control, which you can use to have the client upload a file to your server.

Both WebControls and HTML controls have an attribute collection, but WebControls are simply far richer than HTML controls. WebControls have a full set of properties and also feature a consistent and type-safe object model—consistent meaning that if you know how to set a BorderStyle

Team Fly 


Visual Basic  .NET Power Tools
Visual Basic .NET Power Tools
ISBN: 0782142427
EAN: 2147483647
Year: 2003
Pages: 178

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net