Jit n Run - The Best of Simple Talk - ASP.NET.pdf
(
4060 KB
)
Pobierz
Microsoft Word - JITnRun_al.docx
The Best of Simple Talk
Jit N’ Run
Simple Talk - ASP.NET
Vol.1
In association with
ISBN: 978-1-906434-03-8
Shelving: Development/Computer Science
www.simpletalkpublishing.com
The Best of
i
Jit N' Run: Volume 1
The Best ofSimple-Talk - ASPNET
by Dan Wahlin, Damon Armstrong, Gaidar Magdanurov, Jonas
Stawski, Chris Ullman, Daniel Penrod, John Papa, Jesse Liberty,
Alex Horovitzand John Bower
First pubished 2008 by Simpe-Tak Pubishing
ii
Copyright Dan Wahin, Damon Armstrong, Gaidar Magdanurov, Jonas Stawski, Chris Uman, Daniel Penrod, John Papa, Jesse
Liberty, Aex Horovitz and John Bower 2008
ISBN 978-1-906434-03-8
The right of Dan Wahin, Damon Armstrong, Gaidar Magdanurov, Jonas Stawski, Chris Uman, Daniel Penrod, John Papa,
Jesse Liberty, Aex Horovitz and John Bower to be identified as the author of this work has been asserted by him in accordance
with the Copyright, Designs and Patents Act 1988
Al rights reserved. No part of this pubication may be reproduced, stored or introduced into a retrieval system, or transmitted, in any form, or by
any means (eectronic, mechanica, photocopying, recording or otherwise) without the prior written consent of the pubisher. Any person who does
any unauthorised act in reation to this pubication may be iabe to criminal prosecution and civil caims for damages.
This book is sod subect to the condition that it shal not, by way of trade or otherwise, be ent, re-sod, hired out, or otherwise circuated without
the pubisherÔs prior consent in any form other than which it is pubished and without a simiar condition incuding this condition being imposed
on the subsequent pubisher.
Typeset by Andrew Carke
iii
C
ONTENTS
Contents.............................................................................................................................................3
About the Authors............................................................................................................................8
acknow edgements.........................................................................................................................10
Introduction....................................................................................................................................10
ASP.NET Master Pages Tips and Tricks....................................................................................11
Using the MasterType Directive 11
Creating Master Page Base C asses 12
Hand ing Nested Master Page Design Issues 13
Sharing Master Pages across IIS App ications 14
Conc usion 17
Web Parts in ASP.NET 2.0...........................................................................................................18
A quick refresher on providers 19
The Web Parts provider definition: Persona isationProvider 20
Storing mu tip e pages to a sing e data store 21
Creating the MutiPageSq Persona izationProvider c ass 21
Configuring your new provider in the web.config 24
Configuring the Web Parts manager to use a specific provider configuration 25
Using the demo app ication 25
Conc usion............................................................................................................................26
Imp ementing Waiting Pages in ASP.NET................................................................................27
Architecture of the waiting page so ution.......................................................................27
So utions................................................................................................................................27
The simp est so ution 27
Waiting for more than one process 30
Returning custom data ob ects from the asynchronous processes 35
Adding A ax features 39
Conc usion............................................................................................................................40
Token Rep acement in ASP.NET................................................................................................41
Basic token rep acement concepts....................................................................................41
Token / String Rep acement in ASP.NET.......................................................................42
In ine Script 42
The String.Format Method 42
The String.Rep ace and StringBui der.Rep ace Methods 43
Acquiring A l ASP.NET Page Content.............................................................................44
Writing the Page Source to StringBui der
45
G obal Rep acements
45
iv
Page Specific Rep acements 46
Checking out the demo appication..................................................................................46
Conc usion............................................................................................................................46
Regu ar Expression Based Token Rep acement in ASP.NET.................................................48
What are regu ar expressions?............................................................................................48
So ution overview................................................................................................................49
Matches and captures..........................................................................................................49
Regu ar expression concepts used in the so ution..........................................................51
Backs ash (\) modifier 51
Grouping constructs 51
Character sets 52
Quantifiers 52
Breaking down the token function regu ar expression pattern.....................................53
Adding regu ar expressions to the TokenRep acementPage c ass................................55
System.Text.Regu arExpressions namespace 56
Static Regex variab e 56
RunRegu arExpressionRep acements method 57
CreateParamList method 58
Updating the Render method 58
Checking out the Demo App ication................................................................................59
Conc usion............................................................................................................................59
A Comp ete URL Rewriting So ution for ASP.NET 2.0.........................................................60
Why use URL rewriting?.....................................................................................................60
Usabi ity 60
Maintainabi ity 60
Native URL mapping in ASP.NET 2.0.............................................................................60
The URL rewriting modu e................................................................................................61
Hand ing the configuration section...................................................................................63
Using parameters from rewritten URL.............................................................................64
Rewriting URLs....................................................................................................................65
Registering RewriteModu e in web.config........................................................................68
Using RewriteModu e 68
IIS Configuration: using RewriteModu e with extensions other than .aspx...............69
Conc usions...........................................................................................................................74
Take Row-Level Control of Your GridView.............................................................................75
Manipu ate the GridView control in ASP.NET to disp ay your data the right way..75
Taking advantage of the GridView events and properties
75
The RowDataBound is your friend.
76
Plik z chomika:
m.swicarz
Inne pliki z tego folderu:
ASP.NET 2.0 Website Programming - Problem-Design-Solution.chm
(17412 KB)
Developing.Dot.NET.Enterprise.Applications-1590590466.chm
(9010 KB)
Jit n Run - The Best of Simple Talk - ASP.NET.pdf
(4060 KB)
Programming.Windows.Workflow.Foundation.Dec.2006-1904811213.pdf
(8127 KB)
Inne foldery tego chomika:
Ajax
ASP.NET
C_Sharp
Design Pattern
e-book
Zgłoś jeśli
naruszono regulamin