Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
notice that the example actually inherits from win

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();

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Rose Sheeran

PageId: ELID13288C