Over 10 Million Study Resources Now at Your Fingertips


Download as :
Rating : ⭐⭐⭐⭐⭐
Price : $10.99
Language:EN
Pages: 2

Notice that the example actually inherits from windows form control

452 CHAPTER 15

WORKING WITH CLIENT-SIDE CONTROLS

Listing 15.1 shows the code you’ll use to create the example in this section. Notice that the example actually inherits from a Windows form control, rather than a Web control. You’ll find this example in the \Chapter 15\SampleControl folder of the source code on the Sybex Web site.

Listing 15.1:

public String ResourceURL
{
get
{
// Return the string that the user provided as input or // nothing when the URL is invalid.

if (_ResourceURL == null)
return "";
else
return _ResourceURL.AbsoluteUri;
}
set
{
// Use a try...catch block in case the user passes // something other than a valid URI.

CREATING A CONTROL 453

if (_ResourceURL == null)
return "0";
else
return _ResourceURL.Port.ToString(); }
}

public Boolean IsValidURL
{
get
{
// Verify that the resource URL is valid. The _ResourceURL // variable is null when the URL is invalid.

String TheData; // Contains the actual data.

// If the URL isn't valid, then return.
if (_ResourceURL == null)
return "";

this.Text = "Getting the Response";
Response = (HttpWebResponse)Request.GetResponse();

How It Works
Login account
Login Your Account
Add to cart
Add to Cart
Payment
Make payment
Document download
Download File
PageId: ELID13288C
img
Uploaded by :
g7pOPBqL
Page 1 Preview
notice that the example actually inherits from win
Sell Your Old Documents & Earn Wallet Balance