100% found this document useful (1 vote)
5 views

Beginning ASP NET 3 5 In C and VB 1st Edition Imar Spaanjaars instant download

The document is a promotional overview of the book 'Beginning ASP.NET 3.5 in C# and VB' by Imar Spaanjaars, which provides a comprehensive guide for building dynamic, database-driven websites using ASP.NET 3.5 and Visual Web Developer 2008. It outlines the book's content, including chapters on web design, programming, database interaction, and security, aimed at beginners with no prior web development experience. The document also includes links to download the book and related resources.

Uploaded by

zhadijejy18
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
5 views

Beginning ASP NET 3 5 In C and VB 1st Edition Imar Spaanjaars instant download

The document is a promotional overview of the book 'Beginning ASP.NET 3.5 in C# and VB' by Imar Spaanjaars, which provides a comprehensive guide for building dynamic, database-driven websites using ASP.NET 3.5 and Visual Web Developer 2008. It outlines the book's content, including chapters on web design, programming, database interaction, and security, aimed at beginners with no prior web development experience. The document also includes links to download the book and related resources.

Uploaded by

zhadijejy18
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

Beginning ASP NET 3 5 In C and VB 1st Edition

Imar Spaanjaars pdf download

https://ebookfinal.com/download/beginning-asp-net-3-5-in-c-and-
vb-1st-edition-imar-spaanjaars/

Explore and download more ebooks or textbooks


at ebookfinal.com
Here are some recommended products for you. Click the link to
download, or explore more at ebookfinal

Beginning ASP NET 4 5 in C and VB 1st Edition Imar


Spaanjaars

https://ebookfinal.com/download/beginning-asp-net-4-5-in-c-and-vb-1st-
edition-imar-spaanjaars/

Build Your Own ASP Net 3 5 Web site Using C VB 3rd Edition
Cristian Darie

https://ebookfinal.com/download/build-your-own-asp-net-3-5-web-site-
using-c-vb-3rd-edition-cristian-darie/

Beginning ASP NET in VB NET From Novice to Professional


1st Edition Matthew Macdonald (Auth.)

https://ebookfinal.com/download/beginning-asp-net-in-vb-net-from-
novice-to-professional-1st-edition-matthew-macdonald-auth/

Professional ASP NET 4 in C and VB 1st Edition Bill Evjen

https://ebookfinal.com/download/professional-asp-net-4-in-c-and-
vb-1st-edition-bill-evjen/
Pro VB 2008 and the NET 3 5 Platform Third Edition Windows
Net Andrew Troelsen

https://ebookfinal.com/download/pro-vb-2008-and-the-net-3-5-platform-
third-edition-windows-net-andrew-troelsen/

MCTS Self Paced Training Kit Exam 70 562 Microsoft NET


Framework 3 5 ASP NET Application Development Microsoft r
Net Framework 3 5 ASP Net Application Development Pro
Certification 1st Edition Mike Snell
https://ebookfinal.com/download/mcts-self-paced-training-kit-
exam-70-562-microsoft-net-framework-3-5-asp-net-application-
development-microsoft-r-net-framework-3-5-asp-net-application-
development-pro-certification-1st-edition-mike-sn/

Pro VB 2008 and the NET 3 5 Platform 3rd.Edition Edition


Andrew W. Troelsen

https://ebookfinal.com/download/pro-vb-2008-and-the-
net-3-5-platform-3rd-edition-edition-andrew-w-troelsen/

ASP NET Website Programming Problem Design Solution VB NET


Edition Marco Bellinaso

https://ebookfinal.com/download/asp-net-website-programming-problem-
design-solution-vb-net-edition-marco-bellinaso/

Beginning VB NET 2nd ed Edition Richard Blair

https://ebookfinal.com/download/beginning-vb-net-2nd-ed-edition-
richard-blair/
Beginning ASP NET 3 5 In C and VB 1st Edition Imar
Spaanjaars Digital Instant Download
Author(s): Imar Spaanjaars
ISBN(s): 9780470187593, 047018759X
Edition: 1
File Details: PDF, 35.59 MB
Year: 2008
Language: english
spine=1.536"

Wrox Programmer to Programmer TM Wrox Programmer to Programmer TM

Beginning Spaanjaars

ASP.NET 3.5 In C# and VB


To build effective and eye-catching database-driven web sites, you must
first have a solid framework on which to run your web pages as well as Beginning
a rich environment in order to create and program these web pages.

ASP.NET 3.5
Microsoft’s ASP.NET 3.5 and Visual Web Developer™ 2008 combine forces
to provide you with the ultimate platform on which you can create dynamic
and interactive web applications.
Popular Wrox author Imar Spaanjaars begins by demonstrating how to
obtain and install Visual Web Developer. With each successive chapter,
he introduces you to new technologies that build on knowledge gained
from previous chapters. You’ll learn that both ASP.NET 3.5 and Visual
Web Developer now come with an extensive set of tools that will help you
smoothly program your web applications. With the knowledge you gain from
this book, you will be able to create feature-rich, database-driven, interactive
web sites.

What you will learn from this book


● Ways that ASP.NET Server controls allow you to create complex web
sites with very little code
● How to use the extensive set of CSS tools that help you design your
web pages
● How to program responsive and interactive web pages with either C#
or Visual Basic®
● How to work with databases to create rich, data-driven web pages
Beginning
● How you can easily create a centralized and maintainable site design
● How to secure your web site, providing login functionality and role-based
access to content
Who this book is for
This book is for anyone who wants to build rich and interactive web sites
that run on the Microsoft platform. No prior experience in web development
is assumed.
Enhance Your Knowledge
Advance Your Career
ASP.NET 3.5
Wrox Beginning guides are crafted to make learning programming languages and technologies easier than you think,
providing a structured, tutorial format that will guide you through all the techniques involved.
In C# and VB
www.wrox.com
Recommended Web Development ISBN: 978-0-470-18759-3 In C# and VB
Computer Book
Categories ASP.NET Imar Spaanjaars

$44.99 USA
$48.99 CAN Updates, source code, and Wrox technical support at www.wrox.com
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page ii
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page i

Beginning
ASP.NET 3.5

Chapter 1: Getting Started with ASP.NET 3.5 . . . . . . . . . . . . . . . . . . . . . . . . . 1


Chapter 2: Building an ASP.NET Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Chapter 3: Designing Your Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Chapter 4: Working with ASP.NET Controls . . . . . . . . . . . . . . . . . . . . . . . . . 103
Chapter 5: Programming Your ASP.NET Web Pages . . . . . . . . . . . . . . . . . . . 135
Chapter 6: Creating Consistent Looking Web Sites . . . . . . . . . . . . . . . . . . . 193
Chapter 7: Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Chapter 8: User Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Chapter 9: Validating User Input. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Chapter 10: ASP.NET AJAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Chapter 11: Introduction to Databases. . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Chapter 12: Displaying and Updating Data . . . . . . . . . . . . . . . . . . . . . . . . . 383
Chapter 13: LINQ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Chapter 14: Presenting Data — Advanced Topics . . . . . . . . . . . . . . . . . . . . 475
Chapter 15: Security in Your ASP.NET 3.5 Web Site . . . . . . . . . . . . . . . . . . 517
Chapter 16: Personalizing Web Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Chapter 17: Exception Handling, Debugging, and Tracing . . . . . . . . . . . . . . 591
Chapter 18: Deploying Your Web Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
Appendix A: Exercise Answers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
Appendix B: Configuring SQL Server 2005 . . . . . . . . . . . . . . . . . . . . . . . . . 687
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page ii
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page iii

Beginning
ASP.NET 3.5
In C# and VB

Imar Spaanjaars
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page iv

Beginning ASP.NET 3.5: In C# and VB


Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com

Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana


Published simultaneously in Canada
ISBN: 978-0-470-18759-3

Manufactured in the United States of America


10 9 8 7 6 5 4 3 2 1

Library of Congress Cataloging-in-Publication Data

Spaanjaars, Imar.
Beginning ASP.NET 3.5 / Imar Spaanjaars.
p. cm.
Includes index.
ISBN 978-0-470-18759-3 (pbk. : web)
1. Active server pages. 2. Web sites—Design. 3. Microsoft .NET. I. Title.
TK5105.8885.A26S6815 2006
005.2'76—dc22
2007052406

No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108
of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization
through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers,
MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal
Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or
online at http://www.wiley.com/go/permissions.

Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including
without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or
promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is
sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional serv-
ices. If professional assistance is required, the services of a competent professional person should be sought. Neither the
publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Website is referred
to in this work as a citation and/or a potential source of further information does not mean that the author or the pub-
lisher endorses the information the organization or Website may provide or recommendations it may make. Further,
readers should be aware that Internet Websites listed in this work may have changed or disappeared between when
this work was written and when it is read.

For general information on our other products and services please contact our Customer Care Department within the
United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.

Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are
trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other coun-
tries, and may not be used without written permission. All other trademarks are the property of their respective owners.
Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.

Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be avail-
able in electronic books.
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page v

To my dad — I know you’d be proud


87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page vi
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page vii

About the Author


Imar Spaanjaars graduated in Leisure Management at the Leisure Management School in the Netherlands,
but he quickly changed his career path into the Internet world.

After working for a large corporation and doing some freelance work, he now works for Design IT
(www.designit.nl), an IT company in the Netherlands specializing in Internet and intranet applica-
tions built with Microsoft technologies like ASP.NET 3.5. As a technical director and software designer,
he’s responsible for designing and building medium- to large-scaled e-commerce web sites and portals.

He’s also the tech lead for Dynamicweb Nederland, the Dutch branch of the popular Danish Content
Management System Dynamicweb (www.dynamicweb.nl).

Imar has written books on ASP.NET 2.0 and Macromedia Dreamweaver, all published under the Wrox
brand. He is also one of the top contributors to the Wrox Community Forum at p2p.wrox.com, where
he shares his knowledge with fellow programmers.

Imar lives in Utrecht, the Netherlands, with his girlfriend, Fleur. You can contact him through his personal
web site at http://imar.spaanjaars.com.
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page viii
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page ix

Credits
Acquisitions Director Vice President and Executive Group Publisher
Jim Minatel Richard Swadley

Development Editor Vice President and Executive Publisher


Brian Herrmann Joseph B. Wikert

Lead Technical Editor Project Coordinator, Cover


Peter Lanoie Lynsey Stanford

Technical Editors Compositor


Alexei Gorkov Laurie Stewart, Happenstance Type-O-Rama
John Dunagan
Robert Searing Proofreaders
Kathryn Duggan
Editorial Manager David Parise
Mary Beth Wakefield Rachel Gunn

Production Manager Indexer


Tim Tate Melanie Belkin
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page x
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page xi

Acknowledgments

Writing a book is probably one of the most exhausting but fun and rewarding things I have ever done.
During writing you have to invest a lot of time and effort to put your ideas down into something that
is worth reading by others. After the hard work is done and the book is written, the reward comes from
readers like you who send me e-mails, contact me through my web site, or participate in the online dis-
cussion forums at p2p.wrox.com to discuss the book.

As Norman Mailer put it, writing a book is the closest that men ever get to childbearing. Although I think
there is probably some truth in that statement, I also realize there is one big difference: writing a book is
not something you have to do on your own. Although only my name is on the cover, I owe a lot to many
people who helped me write this book.

First of all I’d like to thank Jim Minatel from Wiley for asking me to pick up this project and having faith
in my ability to bring it to a good end. I would also like to thank Brian Herrmann for his editorial work. I
know it wasn’t always easy with the number of reviewers we had, but I think it turned out pretty well.

I am very thankful for the work done by the technical editors on this book: Alexei, John, and Rob —
thanks, guys, for all your hard work! I particularly want to thank the lead technical editor, Peter Lanoie,
who has made a major contribution, both in shaping the direction of the book and in assuring its technical
accuracy. Thank you, Peter!

I am also very glad for the support I got from the people at Design IT. Thanks to all who have reviewed
my work and participated in my discussions on the book’s direction.

Another person I owe a lot to is Anne Ward from Blue Violet, a UK-based web and graphic design com-
pany. Anne has done most of the designs used in this book, which I highly appreciate. Thanks, Anne!
The concert pictures you see in this book come from her good friend Nigel D. Nudds, who kindly let me
use pictures from his collection.

Finally, I would like to thank my lovely girlfriend, Fleur. You may get tired of hearing it, but I really
appreciate the support you have given me throughout this project. I couldn’t — and wouldn’t — have
done it without you!
87593ffirs.qxd:WroxPro 1/29/08 12:47 AM Page xii
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xiii

Contents

Acknowledgments xi
Introduction xxiii

Chapter 1: Getting Started with ASP.NET 3.5 1


Microsoft Visual Web Developer 2
Getting Visual Web Developer 3
Installing Visual Web Developer Express Edition 3
Creating Your First ASP.NET 3.5 Web Site 5
An Introduction to ASP.NET 3.5 9
Understanding HTML 10
A First Look at ASP.NET Markup 14
A Tour of the IDE 15
The Main Development Area 15
Informational Windows 21
Customizing the IDE 22
Rearranging Windows 22
Modifying the Toolbox 23
Customizing the Document Window 25
Customizing Toolbars 25
Customizing Keyboard Shortcuts 26
Resetting Your Changes 27
The Sample Application 28
Practical Tips on Visual Web Developer 30
Summary 30
Exercises 31

Chapter 2: Building an ASP.NET Web Site 33


Creating Web Sites with VWD 2008 34
Different Project Types 34
Choosing the Right Web Site Template 35
Creating and Opening a New Web Site 36
Working with Files in Your Web Site 39
The Many File Types of an ASP.NET 3.5 Web Site 39
Adding Existing Files 43
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xiv

Contents
Organizing Your Site 44
Special File Types 46
Working with Web Forms 47
The Different Views on Web Forms 47
Choosing between Code Behind and Pages with Inline Code 48
Adding Markup to Your Page 53
Connecting Pages 59
Practical Tips on Working with Web Forms 61
Summary 61
Exercises 62

Chapter 3: Designing Your Web Pages 63


Why Do You Need CSS? 63
Problems of HTML Formatting 64
How CSS Fixes Formatting Problems 65
An Introduction to CSS 65
CSS — The Language 69
The Style Sheet 69
Adding CSS to Your Pages 80
Working with CSS in Visual Web Developer 82
Creating New Styles in External Style Sheets 83
Creating Embedded and Inline Style Sheets 88
Applying Styles 94
Managing Styles 96
Practical Tips on Working with CSS 99
Summary 100
Exercises 100

Chapter 4: Working with ASP.NET Controls 103


Introduction to Server Controls 103
A Closer Look at ASP.NET Server Controls 107
Defining Controls in Your Pages 108
Common Properties for All Controls 108
Types of Controls 110
Standard Controls 111
HTML Controls 124
Data Controls 124
Validation Controls 125
Navigation Controls 125
Login Controls 125

xiv
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xv

Contents
Ajax Extensions 125
WebParts 125
The ASP.NET State Engine 126
What Is State and Why Is It Important? 126
How the State Engine Works 127
Not All Controls Rely on ViewState 131
A Note About ViewState and Performance 131
Practical Tips on Working with Controls 132
Summary 132
Exercises 133

Chapter 5: Programming Your ASP.NET Web Pages 135


Introduction to Programming 136
Data Types and Variables 136
Converting Data Types 140
Using Arrays and Collections 142
Statements 146
Operators 147
Making Decisions 154
Loops 161
Organizing Code 164
Methods: Functions and Subroutines 165
The App_Code Folder 167
Organizing Code with Namespaces 171
Writing Comments 173
Object Orientation Basics 176
Important OO Terminology 176
Events 188
Practical Tips on Programming 189
Summary 190
Exercises 191

Chapter 6: Creating Consistent Looking Web Sites 193


Consistent Page Layout with Master Pages 194
Creating Master Pages 196
Creating Content Pages 198
Using a Centralized Base Page 203
An Introduction to the ASP.NET Page Life Cycle 204
Implementing the Base Page 206
Creating Reusable Page Templates 210

xv
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xvi

Contents
Themes 214
Different Types of Themes 215
Choosing Between Theme and StyleSheetTheme 215
Applying Themes 215
Extending Themes 219
Dynamically Switching Themes 222
Skins 228
Creating a Skin File 229
Named Skins 231
A Final Note on Skins 232
Practical Tips on Creating Consistent Pages 232
Summary 233
Exercises 234

Chapter 7: Navigation 235


Different Ways to Move around Your Site 236
Understanding Absolute and Relative URLs 236
Understanding Default Documents 240
Using the Navigation Controls 241
Architecture of the Navigation Controls 242
Examining the Web.sitemap File 242
Using the Menu Control 244
Using the TreeView Control 253
Using the SiteMapPath Control 257
Programmatic Redirection 259
Programmatically Redirecting the Client to a Different Page 259
Server-Side Redirects 261
Practical Tips on Navigation 264
Summary 264
Exercises 265

Chapter 8: User Controls 267


Introduction to User Controls 267
Creating User Controls 268
Adding User Controls to a Content Page or Master Page 271
Site-Wide Registration of User Controls 274
User Control Caveats 275
Adding Logic to Your User Controls 277
Creating Your Own Data Types for Properties 277

xvi
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xvii

Contents
Implementing ViewState Properties 283
ViewState Considerations 288
Practical Tips on User Controls 289
Summary 289
Exercises 290

Chapter 9: Validating User Input 291


Gathering Data from the User 292
Validating User Input in Web Forms 293
Processing Data at the Server 307
Sending E-mail from Your Web Site 307
Reading from Text Files 313
Practical Tips on Validating Data 318
Summary 318
Exercises 319

Chapter 10: ASP.NET AJAX 321


Introducing Ajax 322
Using ASP.NET AJAX in Your Projects 323
Creating Flicker-Free Pages 323
Providing Feedback to Users 328
Using the Timer Control 332
Using Web Services in Ajax Web Sites 337
What Are Web Services? 337
Creating Web Services 338
Using Web Services in Your Ajax Web Site 342
This Is Just the Beginning 349
Practical Ajax Tips 349
Summary 350
Exercises 351

Chapter 11: Introduction to Databases 353


What Is a Database? 354
Different Kinds of Relational Databases 355
Using SQL to Work with Database Data 355
Retrieving and Manipulating Data 358
Creating Your Own Tables 371
Data Types in SQL Server 371

xvii
87593ftoc.qxd:WroxPro 1/25/08 11:31 AM Page xviii

Contents
Understanding Primary Keys and Identities 373
Creating Relationships Between Tables 377
Practical Database Tips 380
Summary 381
Exercises 381

Chapter 12: Displaying and Updating Data 383


Data Controls 383
Data-Bound Controls 384
Data Source Controls 386
Data Source and Data-Bound Controls Working Together 386
Displaying and Editing Data with GridView 386
Inserting Data with DetailsView 392
Storing Your Connection Strings in web.config 395
Filtering Data 397
Customizing the Appearance of the Data Controls 403
Configuring Columns or Fields of Data-Bound Controls 403
Updating and Inserting Data 409
Using DetailsView to Insert and Update Data 409
Practical Tips for Displaying and Updating Data 422
Summary 423
Exercises 423

Chapter 13: LINQ 425


Introducing LINQ 426
Different Types of LINQ 427
Introducing LINQ to SQL 427
Mapping Your Data Model to an Object Model 428
Introducing Query Syntax 433
Standard Query Operators 433
Shaping Data with Anonymous Types 437
Using Server Controls with LINQ Queries 443
New Controls Introduced in ASP.NET 3.5 443
A Few Notes about Performance 471
Practical LINQ Tips 472
Summary 472
Exercises 473

xviii
Discovering Diverse Content Through
Random Scribd Documents
Segismund. Once more the storm has roar’d itself away,
Splitting the crags of God as it retires;
But sparing still what it should only blast,
This guilty piece of human handiwork,
And all that are within it. Oh, how oft,
How oft, within or here abroad, have I
Waited, and in the whisper of my heart
Pray’d for the slanting hand of heaven to strike
The blow myself I dared not, out of fear
Of that Hereafter, worse, they say, than here,
Plunged headlong in, but, till dismissal waited,
To wipe at last all sorrow from men’s eyes,
And make this heavy dispensation clear.
Thus have I borne till now, and still endure,
Crouching in sullen impotence day by day,
Till some such out-burst of the elements
Like this rouses the sleeping fire within;
And standing thus upon the threshold of
Another night about to close the door
Upon one wretched day to open it
On one yet wretcheder because one more;—
Once more, you savage heavens, I ask of you—
I, looking up to those relentless eyes
That, now the greater lamp is gone below,
Begin to muster in the listening skies;
In all the shining circuits you have gone
About this theatre of human woe,
What greater sorrow have you gazed upon
Than down this narrow chink you witness still;
And which, did you yourselves not fore-devise,
You register’d for others to fulfil!
Fife. This is some Laureate at a birth-day ode;
No wonder we went rhyming.
Ros. Hush! And now
See, starting to his feet, he strides about
See, starting to his feet, he strides about
Far as his tether’d steps—
Seg. And if the chain
You help’d to rivet round me did contract
Since guiltless infancy from guilt in act;
Of what in aspiration or in thought
Guilty, but in resentment of the wrong
That wreaks revenge on wrong I never wrought
By excommunication from the free
Inheritance that all created life,
Beside myself, is born to—from the wings
That range your own immeasurable blue,
Down to the poor, mute, scale-imprison’d things,
That yet are free to wander, glide, and pass
About that under-sapphire, whereinto
Yourselves transfusing you yourselves englass!
Ros. What mystery is this?
Fife. Why, the man’s mad:
That’s all the mystery. That’s why he’s chain’d—
And why—
Seg. Nor Nature’s guiltless life alone—
But that which lives on blood and rapine; nay,
Chartered with larger liberty to slay
Their guiltless kind, the tyrants of the air
Soar zenith-upward with their screaming prey,
Making pure heaven drop blood upon the stage
Of under earth, where lion, wolf, and bear,
And they that on their treacherous velvet wear
Figure and constellation like your own,[13]
With their still living slaughter bound away
Over the barriers of the mountain cage,
Against which one, blood-guiltless, and endued
With aspiration and with aptitude
Transcending other creatures, day by day
Beats himself mad with unavailing rage!
g g
Fife. Why, that must be the meaning of my mule’s
Rebellion—
Ros. Hush!
Seg. But then if murder be
The law by which not only conscience-blind
Creatures, but man too prospers with his kind;
Who leaving all his guilty fellows free,
Under your fatal auspice and divine
Compulsion, leagued in some mysterious ban
Against one innocent and helpless man,
Abuse their liberty to murder mine:
And sworn to silence, like their masters mute
In heaven, and like them twiring through the mask
Of darkness, answering to all I ask,
Point up to them whose work they execute!
Ros. Ev’n as I thought, some poor unhappy wretch,
By man wrong’d, wretched, unrevenged, as I!
Nay, so much worse than I, as by those chains
Clipt of the means of self-revenge on those
Who lay on him what they deserve. And I,
Who taunted Heaven a little while ago
With pouring all its wrath upon my head—
Alas! like him who caught the cast-off husk
Of what another bragg’d of feeding on,
Here’s one that from the refuse of my sorrows
Could gather all the banquet he desires!
Poor soul, poor soul!
Fife. Speak lower—he will hear you.
Ros. And if he should, what then? Why, if he would,
He could not harm me—Nay, and if he could,
Methinks I’d venture something of a life
I care so little for—
Seg. Who’s that? Clotaldo? Who are you, I say,
g y , y,
That, venturing in these forbidden rocks,
Have lighted on my miserable life,
And your own death?
Ros. You would not hurt me, surely?
Seg. Not I; but those that, iron as the chain
In which they slay me with a lingering death,
Will slay you with a sudden—Who are you?
Ros. A stranger from across the mountain there,
Who, having lost his way in this strange land
And coming night, drew hither to what seem’d
A human dwelling hidden in these rocks,
And where the voice of human sorrow soon
Told him it was so.
Seg. Ay? But nearer—nearer—
That by this smoky supplement of day
But for a moment I may see who speaks
So pitifully sweet.
Fife. Take care! take care!
Ros. Alas, poor man, that I, myself so helpless,
Could better help you than by barren pity,
And my poor presence—
Seg. Oh, might that be all!
But that—a few poor moments—and, alas!
The very bliss of having, and the dread
Of losing, under such a penalty
As every moment’s having runs more near,
Stifles the very utterance and resource
They cry for quickest; till from sheer despair
Of holding thee, methinks myself would tear
To pieces—
Fife. There, his word’s enough for it.
Seg. Oh, think, if you who move about at will,
dl h k d
And live in sweet communion with your kind,
After an hour lost in these lonely rocks
Hunger and thirst after some human voice
To drink, and human face to feed upon;
What must one do where all is mute, or harsh,
And ev’n the naked face of cruelty
Were better than the mask it works beneath?—
Across the mountain then! Across the mountain!
What if the next world which they tell one of
Be only next across the mountain then,
Though I must never see it till I die,
And you one of its angels?
Ros. Alas! alas!
No angel! And the face you think so fair,
’Tis but the dismal frame-work of these rocks
That makes it seem so; and the world I come from—
Alas, alas, too many faces there
Are but fair vizors to black hearts below,
Or only serve to bring the wearer woe!
But to yourself—If haply the redress
That I am here upon may help to yours.
I heard you tax the heavens with ordering,
And men for executing, what, alas!
I now behold. But why, and who they are
Who do, and you who suffer—
Seg. (pointing upwards). Ask of them,
Whom, as to-night, I have so often ask’d,
And ask’d in vain.
Ros. But surely, surely—
Seg. Hark!
The trumpet of the watch to shut us in.
Oh, should they find you!—Quick! Behind the rocks!
To-morrow—if to-morrow—
Ros. (flinging her sword toward him). Take my sword!
Rosaura and Fife hide in the rocks; enter Clotaldo.

Clotaldo. These stormy days you like to see the last of


Are but ill opiates, Segismund, I think,
For night to follow: and to-night you seem
More than your wont disorder’d. What! A sword?
Within there!

Enter Soldiers with black vizors and torches.


Fife. Here’s a pleasant masquerade!
Clo. Whosever watch this was
Will have to pay head-reckoning. Meanwhile,
This weapon had a wearer. Bring him here,
Alive or dead.
Seg. Clotaldo! good Clotaldo!—
Clo. (to Soldiers who enclose Segismund; others searching the
rocks). You know your duty.
Soldiers (bringing in Rosaura and Fife). Here are two of them,
Whoever more to follow—
Clo. Who are you,
That in defiance of known proclamation
Are found, at night-fall too, about this place?
Fife. Oh, my Lord, she—I mean he—
Ros. Silence, Fife,
And let me speak for both.—Two foreign men,
To whom your country and its proclamations
Are equally unknown; and, had we known,
Ourselves not masters of our lawless beasts
That, terrified by the storm among your rocks,
Flung us upon them to our cost.
Fife. My mule—
Clo. Foreigners? Of what country?
Ros. Muscovy.
Clo. And whither bound?
Ros. Hither—if this be Poland;
But with no ill design on her, and therefore
Taking it ill that we should thus be stopt
Upon her threshold so uncivilly.
Clo. Whither in Poland?
Ros. To the capital.
Clo. And on what errand?
Ros. Set me on the road,
And you shall be the nearer to my answer.
Clo. (aside). So resolute and ready to reply,
And yet so young—and—— (Aloud) Well,—
Your business was not surely with the man
We found you with?
Ros. He was the first we saw,—
And strangers and benighted, as we were,
As you too would have done in a like case,
Accosted him at once.
Clo. Ay, but this sword?
Ros. I flung it toward him.
Clo. Well, and why?
Ros. And why?
But to revenge himself on those who thus
Injuriously misuse him.
Clo. So—so—so!
’Tis well such resolution wants a beard—
And, I suppose, is never to attain one.
Well, I must take you both, you and your sword,
Prisoners.
Fife. (offering a cudgel). Pray take mine, and welcome, sir;
I’m sure I gave it to that mule of mine
To mighty little purpose.
Ros. Mine you have;
And may it win us some more kindliness
Than we have met with yet.
Clo. (examining the sword). More mystery!
How came you by this weapon?
How came you by this weapon?
Ros. From my father.
Clo. And do you know whence he?
Ros. Oh, very well:
From one of this same Polish realm of yours,
Who promised a return, should come the chance,
Of courtesies that he received himself
In Muscovy, and left this pledge of it—
Not likely yet, it seems, to be redeem’d.
Clo. (aside). Oh, wondrous chance—or wondrous Providence:
The sword that I myself in Muscovy,
When these white hairs were black, for keepsake left
Of obligation for a like return
To him who saved me wounded as I lay
Fighting against his country; took me home;
Tended me like a brother till recover’d,
Perchance to fight against him once again—
And now my sword put back into my hand
By his—if not his son—still, as so seeming,
By me, as first devoir of gratitude,
To seem believing, till the wearer’s self
See fit to drop the ill-dissembling mask.
(Aloud) Well, a strange turn of fortune has arrested
The sharp and sudden penalty that else
Had visited your rashness or mischance:
In part, your tender youth too—pardon me,
And touch not where your sword is not to answer—
Commends you to my care; not your life only,
Else by this misadventure forfeited;
But ev’n your errand, which, by happy chance,
Chimes with the very business I am on,
And calls me to the very point you aim at.
Ros. The capital?
Clo. Ay, the capital; and ev’n
Th t it l f it l th C t
That capital of capitals, the Court:
Where you may plead, and, I may promise, win
Pardon for this, you say unwilling, trespass,
And prosecute what else you have at heart,
With me to help you forward all I can;
Provided all in loyalty to those
To whom by natural allegiance
I first am bound to.
Ros. As you make, I take
Your offer: with like promise on my side
Of loyalty to you and those you serve,
Under like reservation for regards
Nearer and dearer still.
Clo. Enough, enough;
Your hand; a bargain on both sides. Meanwhile,
Here shall you rest to-night. The break of day
Shall see us both together on the way.
Ros. Thus then what I for misadventure blamed,
Directly draws me where my wishes aim’d.
[Exeunt.

Scene II.—The Palace at Warsaw.

Enter on one side Astolfo, Duke of Muscovy, with his train; and, on
the other, the Princess Estrella, with hers.
Astolfo. My royal cousin, if so near in blood,
Till this auspicious meeting scarcely known,
Till all that beauty promised in the bud
Is now to its consummate blossom blown,
Well met at last; and may—
Estrella. Enough, my Lord,
Of compliment devised for you by some
Court tailor, and, believe me, still too short
To cover the designful heart below.
Ast. Nay, but indeed, fair cousin—
Est. Ay, let Deed
Measure your words, indeed your flowers of speech
Ill with your iron equipage atone;
Irony indeed, and wordy compliment.
Ast. Indeed, indeed, you wrong me, royal cousin,
And fair as royal, misinterpreting
What, even for the end you think I aim at,
If false to you, were fatal to myself.
Est. Why, what else means the glittering steel, my Lord,
That bristles in the rear of these fine words?
What can it mean, but, failing to cajole,
To fight or force me from my just pretension?
Ast. Nay, might I not ask ev’n the same of you,
The nodding helmets of whose men at arms
Out-crest the plumage of your lady court?
Est. But to defend what yours would force from me.
Ast. Might not I, lady, say the same of mine?
But not to come to battle, ev’n of words,
With a fair lady, and my kinswoman;
And as averse to stand before your face,
Defenceless, and condemn’d in your disgrace,
Till the good king be here to clear it all—
Will h f t h ?
Will you vouchsafe to hear me?
Est. As you will.
Ast. You know that, when about to leave this world,
Our royal grandsire, King Alfonso, left
Three children; one a son, Basilio,
Who wears—long may he wear!—the crown of Poland;
And daughters twain: of whom the elder was
Your mother, Clorileña, now some while
Exalted to a more than mortal throne;
And Recisunda, mine, the younger sister,
Who, married to the Prince of Muscovy,
Gave me the light which may she live to see
Herself for many, many years to come.
Meanwhile, good King Basilio, as you know,
Deep in abstruser studies than this world,
And busier with the stars than lady’s eyes,
Has never by a second marriage yet
Replaced, as Poland ask’d of him, the heir
An early marriage brought and took away;
His young queen dying with the son she bore him:
And in such alienation grown so old
As leaves no other hope of heir to Poland
Than his two sisters’ children; you, fair cousin,
And me; for whom the Commons of the realm
Divide themselves into two several factions;
Whether for you, the elder sister’s child;
Or me, born of the younger, but, they say,
My natural prerogative of man
Outweighing your priority of birth.
Which discord growing loud and dangerous,
Our uncle, King Basilio, doubly sage
In prophesying and providing for
The future, as to deal with it when come,
Bids us here meet to-day in solemn council
Our several pretensions to compose.
And but the martial out burst that proclaims
And, but the martial out-burst that proclaims
His coming, makes all further parley vain,
Unless my bosom, by which only wise
I prophesy, now wrongly prophesies,
By such a happy compact as I dare
But glance at till the Royal Sage declare.
Trumpets, etc. Enter King Basilio with his Council.

All. The King! God save the King!

Estrella. Oh, Royal Sir!—


} (Kneeling)
Astolfo. God save your Majesty!—
King. Rise, both of you,
Rise to my arms, Astolfo and Estrella;
As my two sisters’ children always mine,
Now more than ever, since myself and Poland
Solely to you for our succession look’d.
And now give ear, you and your several factions,
And you, the Peers and Princes of this realm,
While I reveal the purport of this meeting
In words whose necessary length I trust
No unsuccessful issue shall excuse.
You and the world who have surnamed me ‘Sage’
Know that I owe that title, if my due,
To my long meditation on the book
Which ever lying open overhead—
The book of heaven, I mean—so few have read;
Whose golden letters on whose sapphire leaf,
Distinguishing the page of day and night,
And all the revolution of the year;
So with the turning volume where they lie
Still changing their prophetic syllables,
They register the destinies of men:
Until with eyes that, dim with years indeed,
Are quicker to pursue the stars than rule them,
I get the start of Time, and from his hand
The wand of tardy revelation draw.
Oh, had the self-same heaven upon his page
Inscribed my death ere I should read my life
And, by fore-casting of my own mischance,
Play not the victim but the suicide
In my own tragedy!—But you shall hear.
You know how once, as kings must for their people,
And only once, as wise men for themselves,
I woo’d and wedded: know too that my Queen
In childing died; but not, as you believe,
With her, the son she died in giving life to.
For as the hour of birth was on the stroke
For, as the hour of birth was on the stroke,
Her brain conceiving with her womb, she dream’d
A serpent tore her entrail. And too surely
(For evil omen seldom speaks in vain)
The man-child breaking from that living tomb
That makes our birth the antitype of death,
Man-grateful, for the life she gave him paid
By killing her: and with such circumstance
As suited such unnatural tragedy;
He coming into light, if light it were
That darken’d at his very horoscope,
When heaven’s two champions—sun and moon I mean—
Suffused in blood upon each other fell
In such a raging duel of eclipse
As hath not terrified the universe
Since that which wept in blood the death of Christ:
When the dead walk’d, the waters turn’d to blood,
Earth and her cities totter’d, and the world
Seem’d shaken to its last paralysis.
In such a paroxysm of dissolution
That son of mine was born; by that first act
Heading the monstrous catalogue of crime,
I found fore-written in his horoscope;
As great a monster in man’s history
As was in nature his nativity;
So savage, bloody, terrible, and impious,
Who, should he live, would tear his country’s entrails,
As by his birth his mother’s; with which crime
Beginning, he should clench the dreadful tale
By trampling on his father’s silver head.
All which fore-reading, and his act of birth
Fate’s warrant that I read his life aright;
To save his country from his mother’s fate,
I gave abroad that he had died with her
His being slew; with midnight secrecy
I had him carried to a lonely tower
Hewn from the mountain-barriers of the realm
Hewn from the mountain-barriers of the realm,
And under strict anathema of death
Guarded from men’s inquisitive approach,
Save from the trusty few one needs must trust;
Who while his fasten’d body they provide
With salutary garb and nourishment,
Instruct his soul in what no soul may miss
Of holy faith, and in such other lore
As may solace his life-imprisonment,
And tame perhaps the Savage prophesied
Toward such a trial as I aim at now,
And now demand your special hearing to.
What in this fearful business I have done,
Judge whether lightly or maliciously,—
I, with my own and only flesh and blood,
And proper lineal inheritor!
I swear, had his foretold atrocities
Touch’d me alone, I had not saved myself
At such a cost to him; but as a king,—
A Christian king,—I say, advisedly,
Who would devote his people to a tyrant
Worse than Caligula fore-chronicled?
But even this not without grave mis-giving,
Lest by some chance mis-reading of the stars,
Or mis-direction of what rightly read,
I wrong my son of his prerogative,
And Poland of her rightful sovereign.
For, sure and certain prophets as the stars,
Although they err not, he who reads them may;
Or rightly reading—seeing there is One
Who governs them, as, under Him, they us,
We are not sure if the rough diagram
They draw in heaven and we interpret here,
Be sure of operation, if the Will
Supreme, that sometimes for some special end
The course of providential nature breaks
By miracle may not of these same stars
By miracle, may not of these same stars
Cancel his own first draft, or overrule
What else fore-written all else overrules.
As, for example, should the Will Almighty
Permit the Free-will of particular man
To break the meshes of else strangling fate—
Which Free-will, fearful of foretold abuse,
I have myself from my own son for-closed
From ever possible self-extrication;
A terrible responsibility,
Not to the conscience to be reconciled
Unless opposing almost certain evil
Against so slight contingency of good.
Well—thus perplex’d, I have resolved at last
To bring the thing to trial: whereunto
Here have I summon’d you, my Peers, and you
Whom I more dearly look to, failing him,
As witnesses to that which I propose;
And thus propose the doing it. Clotaldo,
Who guards my son with old fidelity,
Shall bring him hither from his tower by night
Lockt in a sleep so fast as by my art
I rivet to within a link of death,
But yet from death so far, that next day’s dawn
Shall wake him up upon the royal bed,
Complete in consciousness and faculty,
When with all princely pomp and retinue
My loyal Peers with due obeisance
Shall hail him Segismund, the Prince of Poland.
Then if with any show of human kindness
He fling discredit, not upon the stars,
But upon me, their misinterpreter,
With all apology mistaken age
Can make to youth it never meant to harm,
To my son’s forehead will I shift the crown
I long have wish’d upon a younger brow;
And in religious humiliation
And in religious humiliation,
For what of worn-out age remains to me,
Entreat my pardon both of Heaven and him
For tempting destinies beyond my reach.
But if, as I misdoubt, at his first step
The hoof of the predicted savage shows;
Before predicted mischief can be done,
The self-same sleep that loosed him from the chain
Shall re-consign him, not to loose again.
Then shall I, having lost that heir direct,
Look solely to my sisters’ children twain
Each of a claim so equal as divides
The voice of Poland to their several sides,
But, as I trust, to be entwined ere long
Into one single wreath so fair and strong
As shall at once all difference atone,
And cease the realm’s division with their own.
Cousins and Princes, Peers and Councillors,
Such is the purport of this invitation,
And such is my design. Whose furtherance
If not as Sovereign, if not as Seer,
Yet one whom these white locks, if nothing else,
To patient acquiescence consecrate,
I now demand and even supplicate.
Ast. Such news, and from such lips, may well suspend
The tongue to loyal answer most attuned;
But if to me as spokesman of my faction
Your Highness looks for answer; I reply
For one and all—Let Segismund, whom now
We first hear tell of as your living heir,
Appear, and but in your sufficient eye
Approve himself worthy to be your son,
Then we will hail him Poland’s rightful heir.
What says my cousin?
Est. Ay, with all my heart.
But if my youth and sex upbraid me not
But if my youth and sex upbraid me not
That I should dare ask of so wise a king—
King. Ask, ask, fair cousin! Nothing, I am sure,
Not well consider’d; nay, if ’twere, yet nothing
But pardonable from such lips as those.
Est. Then, with your pardon, Sir—if Segismund,
My cousin, whom I shall rejoice to hail
As Prince of Poland too, as you propose,
Be to a trial coming upon which
More, as I think, than life itself depends,
Why, Sir, with sleep-disorder’d senses brought
To this uncertain contest with his stars?
King. Well ask’d indeed! As wisely be it answer’d!—
Because it is uncertain, see you not?
For as I think I can discern between
The sudden flaws of a sleep-startled man,
And of the savage thing we have to dread;
If but bewilder’d, dazzled, and uncouth,
As might the sanest and the civilest
In circumstance so strange—nay, more than that,
If moved to any out-break short of blood,
All shall be well with him; and how much more,
If ’mid the magic turmoil of the change,
He shall so calm a resolution show
As scarce to reel beneath so great a blow!
But if with savage passion uncontroll’d
He lay about him like the brute foretold,
And must as suddenly be caged again;
Then what redoubled anguish and despair,
From that brief flash of blissful liberty
Remitted—and for ever—to his chain!
Which so much less, if on the stage of glory
Enter’d and exited through such a door
Of sleep as makes a dream of all between.
Est. Oh kindly answer, Sir, to question that
To charitable courtesy less wise
Might call for pardon rather! I shall now
Gladly, what, uninstructed, loyally
I should have waited.
Ast. Your Highness doubts not me,
Nor how my heart follows my cousin’s lips,
Whatever way the doubtful balance fall,
Still loyal to your bidding.
Omnes. So say all.
King. I hoped, and did expect, of all no less—
And sure no sovereign ever needed more
From all who owe him love or loyalty.
For what a strait of time I stand upon,
When to this issue not alone I bring
My son your Prince, but ev’n myself your King:
And, whichsoever way for him it turn,
Of less than little honour to myself.
For if this coming trial justify
My thus withholding from my son his right,
Is not the judge himself justified in
The father’s shame? And if the judge proved wrong,
My son withholding from his right thus long,
Shame and remorse to judge and father both:
Unless remorse and shame together drown’d
In having what I flung for worthless found.
But come—already weary with your travel,
And ill refresh’d by this strange history,
Until the hours that draw the sun from heaven
Unite us at the customary board,
Each to his several chamber: you to rest;
I to contrive with old Clotaldo best
The method of a stranger thing than old
Time has as yet among his records told.
[Exeunt.
ACT II

Scene I.—A Throne-room in the Palace. Music within.

Enter King and Clotaldo, meeting a Lord in waiting.


Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like