Index

A

Analytics class, 299

ASP.NET Web Helpers Library

Analytics class, 299

Facebook, 283293

Gravatar, 293294

LinkShare helper, 295296

ReCaptcha helper, 296298

Twitter, 278283

Xbox Live Gamer Card, 295

ASP.NET Web Pages, 6

caching mechanism, 454456

cookies, 122

limitations, 123

debugging

HTTP requests analysis, 452453

Microsoft Visual Studio, 453

Mozilla Firefox Firebug, 452

object information display, 446447

output expressions, 447449

server information display, 444446

tools of Google Chrome Developer, 451

tools of Internet Explorer developer, 450451

tools of web browsers, 449

deployment

configuring external database connections, 470471

finding hosting provider, 464468

manual configuration, 469470

Publish Settings, 468

publishing Web Site, 471473

PublishSettings file, 469

Helpers, 117

App_Code folder, 118

functions, 119120

pre-written helpers, 117

ProductInfo helper, 118

layout, 103

Layout pages, 108110

optional section, 114

passing data to layout and partial pages, 114117

RenderPage() method, 104108

RenderSection() method, 110113

maintaining session state, 121

identifiers, 121

variables, 121

search engine optimization (SEO), 457462

other Web sites analysis, 464

performance report, 462463

startup code, 123

Application Level Code, 123124

Folder Level Code, 124125

syntax, 95

adding complex code, 9899

adding single-line server-side code, 9697

Razor parser, @ symbol, 100103

URLs, 125

and passing data, 126, 127

and routing, 126

B

Booleans, 54

<button> element, 136137

C

C# Coding Conventions, 54

C# Primer

collections

arrays, 6972

generic collections, 7274

conditions

if–else statements, 7576

switch statement, 7778

try–catch block, 7879

dynamic variable, 92

ExpandoObject(), 92

loops

do loop, 81

for loop, 8182

foreach loop, 8283

while loop, 80

object oriented programming (OOP)

anonymous types, 91

classes and objects, 8384

constructors, 87

events and delegates, 87

fields and properties, 8485

generics, 91

inheritance, 8889

interface, 9091

methods, 8586

namespaces, 8990

principles and terminology, 83

static classes and members, 8788

operators

arithmetic, 6465

assignment, 6566

conditional, 6869

equality, 67

relational, 6768

types and variables

Booleans, 54

dates and times, 6263

naming identifiers, 5254

numbers, 5458

strings, 5862

C# Reserved words, 53

Caching mechanism, 454456

Changing case, 60

Chart helper

creating chart using .NET collection, 208

AddSeries() method, 208

AddTitle() method, 208

generic dictionary collection, 209

Write() method, 208

creating chart using database query, 209

AddSeries() method, 210

AddTitle() method, 210

column chart, 211

Database.Query() method, 210

DataBindTable(), 210

DataBindTable() method, 210

products data, 210

Query() method, 210

sales table schema, 209

Write() method, 210

displaying chart in web page, 211212

displaying different chart types, 213

saving charts, 216

as image files, 219220

caching charts, 216219

styling and formatting WebMatrix charts, 214

AddLegend() method, 215

built-in themes, 214

specifying theme and displaying chart legend, 216

Client-side validation, 152154

Concatenation and StringBuilder, 6162

Confirming registration by email

account confirmation page, 263264

generating and sending confirmation email, 261263

WebMail Helper, 260263

Constructors, 87

Content protection

restricting to authenticated users

better user experience, 243245

folder level access restriction, 241243

page level access restriction, 241

roles

deleting roles, 254255

listing and adding roles, 245248

listing role members and adding users to roles, 248252

removing users from roles, 252253

restricting access using roles, 255

updating AccountSummary Helper, 256

Cookies, 122

limitations, 123

Create Read Update and Delete (CRUD) operations, 171

Cross-browser compatibility issues, 34

Cross-site request forgery (XSRF), 158159

Cross-site scripting (XSS), 155158

CRUD. See Create Read Update and Delete (CRUD) operations

CSS styles, 381

D

Data access in WebMatrix

adding records, 186190

database connection, 183

deleting records, 195197

editing existing data, 190195

retrieving and displaying data, 184186

Data types, SQL Server Compact Edition database

bigint, 173

binary, 173

bit, 174

datetime, 174

float, 174

image, 174

int, 174

money, 174

nchar, 174

ntext, 174

numeric, 174

nvarchar, 174

real, 175

rowversion, 175

smallint, 175

tinyint, 175

uniqueidentifier, 175

varbinary, 175

Database.Query() method, 202

Debugging, 7, 443

HTTP requests analysis, 452453

Microsoft Visual Studio, 453

Mozilla Firefox Firebug, 452

object information display, 446447

output expressions, 447449

server information display, 444446

tools of Google Chrome Developer, 451

tools of Internet Explorer developer, 450451

tools of web browsers, 449

Deployment, 7

configuring external database connections, 470471

finding hosting provider, 464468

manual configuration, 469470

Publish Settings, 468

publishing Web Site, 471473

PublishSettings File, 469

do loop, 81

Don't Repeat Yourself (DRY) principle, 103

E

E-commerce Site. See TechieTogs application

Events and delegates, 87

Execute() method, 189

ExecuteNonQuery() method, 189

F

Facebook

helpers requiring initialization, 287293

using without registration or initialization, 284287

Floating-point types, 56

for loop, 8182

foreach loop, 8283

<form> tag, 129

Forms and validation

HTML form helpers

Html.CheckBox(), 140

Html.DropDownList(), 142

Html.Label(), 144

Html.ListBox(), 144

Html.RadioButton(), 141

Html.TextArea(), 141

Html.TextBox(), Html.Password() and Html.Hidden(), 139

HTML forms

<button> element, 136137

<input> tag, 130134

<select> element, 134136

<textarea> element, 137

label and fieldset tags, 137139

security

cross-site request forgery (XSRF), 158159

cross-site scripting (XSS), 155158

validating user input

client-side validation, 152153

combination of client and server-side validation, 153, 155

server-side validation, 151152

validation

displaying results, 163165

library, 165168

ModelState, 162163

performing, 159162

using functions, 168169

with WebMatrix

accessing submitted form data, 148151

identifying form submissions, 146148

G

Generic collections

Dictionary<TKey, TValue>, 73

IEnumerable<T>, 74

List<T>, 72

var keyword, 74

Google +1 Helper Package, 320321

Gravatar, 293294

GUIDs, 421

H

Helpers, 117

App_Code folder, 118

functions, 119120

pre-written helpers, 117

ProductInfo helper, 118

Html.CheckBox(), 140

Html.DropDownList(), 142

Html.Label(), 144

Html.ListBox(), 144

Html.RadioButton(), 141

Html.TextArea(), 141

Html.TextBox(), Html.Password() and Html.Hidden(), 139

HTTP post method, 186

I, J, K

IComparable interface, 166

if-else statements, 7576

Images

adding text as a watermark, 429431

adding watermarks, 428

cropping, 424426

flipping and rotating, 426428

resizing, 422424

uploading, 419422

using another image as a watermark, 431434

Inheritance, 8889

<input> tag, 130134

Integrated development environment (IDE). See Microsoft WebMatrix

Interacting with data, 177

deleting data, 182

delete command, 182

WHERE clause, 182

fetching data, 178

like statement, 179

select command, 178, 179

sorting by multiple columns, 181

sorting in reverse-alphabetical order, 180

wildcard characters, 179, 180

inserting data, 181

updating data, 182

Interfaces, 9091

L

Label and fieldset tags, 137139

LinkShare helper, 295296

M

Methods, 8586

Microsoft WebMatrix

adding records, 186190

database connection, 183

deleting records, 195197

editing existing data, 190195

helpers, 197

Chart helper (see Chart helper)

WebGrid helper (see WebGrid helper)

Integrated Development Environment (IDE), 30

adding Web page, 3437

HTML, 3741

Navigation and Content Panes, 32, 33

Notifications Area, 33

Razor Code, 4147

Ribbon Control, 32

Workspace Selector, 31

Microsoft Web Platform Installer

accepting license terms, 14

home page, 12

Install button, 14

installation page, 13

QuickStart page, 15

shortcut, 13

toolset (see WebMatrix toolset)

User Account Control dialog box, 13

retrieving and displaying data, 184186

Web Sites, 18

Bakery template, 27

Empty Site template, 25

My Sites option, 18

Photo Calendar template, 27, 29

Photo Gallery template, 27, 28

Site from Folder option, 24

Site from Template option, 24, 25

Site from Web Gallery option, 1923

Starter Site template, 25, 26

ModelState, 162163

Mozilla Firefox Firebug, 452

N

Namespaces, 8990

Naming identifiers, 5254

Numbers types, 5458

Numeric conversions, 5658

Numeric types

floating-point types, 56

integral types, 5455

numeric conversions, 5658

strings, 5862

O

Object oriented programming (OOP)

anonymous types, 91

constructors, 87

events and delegates, 87

fields and properties, 8485

generics, 91

inheritance, 8889

interface, 9091

methods, 8586

namespaces, 8990

principles and terminology, 83

static classes and members, 8788

P

Protecting content. See Content protection

PublishSettings File, 469

Q

QuerySingle() method, 193

R

Razor

comments, 100

cookies, 122

limitations, 123

Helpers, 117

App_Code folder, 118

functions, 119120

pre-written helpers, 117

ProductInfo helper, 118

layout, 103

Layout pages, 108110

optional section, 114

passing data to layout and partial pages, 114117

RenderPage() method, 104108

RenderSection() method, 110113

maintaining session state, 121

identifiers, 121

variables, 121

startup code, 123

Application Level Code, 123124

Folder Level Code, 124125

syntax, 95

adding complex code, 9899

adding single-line server-side code, 9697

Razor parser, @ symbol, 100103

URLs, 125

and passing data, 126, 127

and routing, 126

Razor syntax, 50

Real-world development, 7

ReCaptcha helper, 296298

RenderPage() method, 104108

Robots Exclusion Protocol, 25

Robots.txt, 25

S

Search engine optimization (SEO), 7, 457462

other Web sites analysis, 464

performance report, 462463

Security and membership

AccountSummary helper, 232234

content protection

restricting to authenticated users, 241245

roles, 245256

Log in Page, 234236

Logout Page, 237

new user registration page creation, 228232

passwords changing, 238240

storing additional user information, 257259

confirming registration by email, 260264

forgotten passwords, 264268

WebSecurity Helper setting, 225228

Security and web site membership, 7

<select> element, 134136

Server-side validation, 151152

Session state, 121

identifiers, 121

variables, 121

Shopping cart

adding ‘Continue Shopping’ and ‘Proceed to Checkout’ buttons, 344346

adding items to cart, 340341

Cart Class, 334336

CartItem Class, 336

displaying empty cart, 339340

displaying product title, 341342

removing items, 342344

Shopping Cart Page, 336339

Social network integration, 7

SQL derver compact edition, 7

SQL Server Compact Edition, 7

SQL Server Compact Edition database

connecting to SQL Server or MySQL database, 221

creating new connection, 222223

web.config file, 223

creating tables, 172

column properties, 173

data types, 173

employees table, 175177

table design tool, WebMatrix IDE, 172

data access in WebMatrix, 183

adding records, 186190

database connection, 183

deleting records, 195197

editing existing data, 190195

retrieving and displaying data, 184186

deleting data, 182

delete command, 182

WHERE clause, 182

fetching data, 178

like statement, 179

select command, 178, 179

sorting by multiple columns, 181

sorting in reverse-alphabetical order, 180

wildcard characters, 179, 180

inserting data, 181

migrating SQL server database, 220

Migrate button, 221

Migrate Database dialog, 221

updating data, 182

WebMatrix helpers, 197

Chart helper (see Chart helper)

WebGrid helper (see WebGrid helper)

Startup code, 123

Application Level Code, 123124

Folder Level Code, 124125

Static classes and members, 8788

String length, 60

String.Format(), 60

Strings

changing case, 60

concatenation and StringBuilder, 6162

other methods, 6061

string length, 60

String.Format(), 60

ToString(), 59

Switch statement, 7778

T

TechieTogs application

Account Summary Helper, 384385

adding database

adding data to tables, 308309

creating Tables, 307308

adding product images, 405408

displaying product images, 409413

adding social networking features

adding Google +1, Twitter, and Facebook buttons, 321322

Google +1 Helper Package, 320321

Admin area

creating Admin role, 378

creating and securing Admin folder, 379

checkout process

Checkout page, 369374

Order Complete page, 374

preparing database, 367368

creating product catalog, 309310

categories list, 311313

Product Details page, 317320

Product Listings page, 313316

displaying dynamic content

Featured Product, 413416

popular products, 416418

error pages

displaying default error page, 327329

Not Found errors, 329331

produced by ASP.NET runtime, 327

produced by IIS, 326

orders administration

Order Details page, 390393

Orders Summary page, 388390

Page Layout, 302306

product administration

Product Details page, 402405

Products Summary page, 400401

product categories, 393396

deleting, 397399

editing, 396397

searching catalog, 323325

shopping cart

adding ‘Continue Shopping’ and ‘Proceed to Checkout’ buttons, 344346

adding items to cart, 340341

Cart Class, 334336

CartItem Class, 336

displaying empty cart, 339340

displaying product title, 341342

removing items, 342344

Shopping Cart Page, 336339

shopping process, 333334

site administration home page, 383

Admin Layout Page, 379380

Admin Menu, 380

Admin stylesheet, 381383

user accounts

Account Summary Helper, 353357

Change Password page, 360362

Forgotten Password page, 362367

initializing membership system, 347

login page, 357359

logout page, 359

registering new accounts, 348352

requirement, 347

user administration, 385388

Ternary operator, 77

<textarea> element, 137

ToString(), 59

Transact-SQL, 177

try-catch block, 7879

T-SQL. See Transact-SQL

Twitter

buttons, 280283

displaying tweets, 279280

U

URLs, 125

and passing data, 126, 127

and routing, 126

V

Videos

embedding flash video, 434437

embedding Microsoft Silverlight video, 439441

embedding Windows MediaPlayer video, 437439

W

Watermarks

adding text, 429431

adding to, 428

using another image as, 431434

Web design. See Microsoft WebMatrix

Web Helper packages

accessing Package Manager, 271275

ASP.NET Web Helpers Library

adding search with Bing, 276278

Analytics class, 299

Facebook, 283293

Gravatar, 293294

LinkShare helper, 295296

ReCaptcha helper, 296298

Twitter, 278283

Xbox Live Gamer Card, 295

installing, 275276

Web.config file, 223

WebGrid helper

applying grid-wide styles, 203

alternatingRowStyle, 203

employee grid, 205

footerStyle, 203

GetHtml style parameters, 203

GetHtml() method, 203

headerStyle, 203

rowStyle, 203

selectedRowStyle, 203

tableStyle, 203

displaying data, 198199

formatting columns, 199

Database.Query() method, 202

GetHtml() method, 201

WebGridColumn class, 201

WebGridColumn properties, 200, 202

pagination, 205

customizing pager control links, 207

employee grid, 206

WebGridPagerMode members, 206

WebGridColumn properties

CanSort, 200

ColumnName, 200

Format, 200

Header, 200

Style, 200

WebMatrix

advantages, 34

ASP.NET platform, 45

ASP.NET Web Pages, 6

data-driven pages, 2

debugging, 7

deployment, 7

dynamic Web pages, 2

forms and validation, 7

installation, 6

interacting with databases, 7

language, 6

on-line community, 8

pragmatic solution, 23

real-world development, 7

search engine optimization (SEO), 7

security and web site membership, 7

social network integration, 7

system requirements, 9

tools, 6

tools and technologies, 1

useful for, 6

WebMatrix Chart helper, types of, 213

WebMatrix IDE

Navigation and Content Panes, 32, 33

Notifications Area, 33

Ribbon control, 32

Workspace Selector, 31

Databases workspace, 32

Files workspace, 31

Reports workspace, 32

Site workspace, 31

WebMatrix toolset

ASP.NET Web Pages, 16

ASP.NET Web Pages Language Packs, 18

IIS 7.5 Express, 16

Integrated Development Environment (IDE), 17

Microsoft SQL Server Compact 4.0 Tools, 17

SQL Server Compact 4.0, 17

SQL Server Management Objects component, 18

SQL Server Native Client, 17

SQL Server System CLR Types package, 17

Web Deployment Tool, 18

WebMatrix Web Gallery, 19, 20

configuring site, 21

WordPress installation, 20, 22, 23

while loop, 80

X, Y, Z

Xbox Live Gamer Card, 295

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.185.196