MeasureUp, Jeff Randall, mobile: 801-847-3124, email: jrandall@certiport.com. Cost is
$550 for unlimited keys for a year which is good if you have 10 or more students,
otherwise purchase 4 or more licenses, get a 40% discount off the normal $90 for
a single license
To Do Items
How do I quickly select which CSS element is associated with a tag in
Visual Studio?
How do you get an ASP.NET Web Site (.NET Framework 4 with Visual Basic)
to work on Godaddy? I can get ASP.NET Empty Web Site to work but this
doesn't have the login template stuff. How do I change the default settings
in an ASP.NET Web Site template?
godaddy customer# 3504514 and help# 1-877-818-4576
ftp ftp.journey-education.org username: journeyeducati password: Normalwebname1 (default password is Password1)
IP address: 173.201.150.1 ftp port is 21. which is standard
ftp://journey-education.org
can only ftp to the primary domain (e.g. coolexample.com) when using Shared Hosting.
Cannot do ftp.anothercoolexample.com when using Shared Hosting.
Need to have
Virtual or Dedicated Hosting, then can do ftp.coolexample.com and ftp.anothercoolexample.com
according to the sales rep Jason.
Godaddy does not allow access IIS 7 manager but can manage the IIS 7
settings and applications through the Hosting Control Center
(see Godaddy Help Center -
Can I connect to the IIS manager under IIS 7?)
Problem - I created a folder at the root level called wwwroot but can't browse to this
using Internet Explorer
Login to godaddy account and open the Hosting Control Center v2.10.0
click Content then IIS Management
check the folder, then click Edit button and get three options
Anonymous Access
Directory Browsing
Set Application Root I have this unchecked)
Godaddy tech support says to click the Recycle App Pool button (these takes a few minutes
but still have a problem)
Problem is with the Web.config file under wwwroot, which makes me think the issue is going
from ASP.NET 3.5 to ASP.NET 4.0. When I remove the Web.config file, then I can browse the folder
assuming there isn't any default.html files.
Problem - I can only see html files at the root level, when I create a folder and add
an html file to it, Internet Explorer returns a Server Error (500 - Internal server
error. There is a problem with the resource you are looking for, and it cannot
be displayed.)
Active Mode: Active FTP benefits the server administrator. In active
mode, the client initializes a connection to the server for the command port
and passes to the server the port address for the data. The server then
initializes a connection back to the client to open the data port.
Passive Mode: Passive FTP benefits a client behind a firewall.
If the client is behind a firewall, the server's attempt to open a port on
the client computer will likely fail. In passive mode, the client initializes
the connections for both the command port and the data port. Because the client
initializes the connection for both ports, the firewall allows the connections.
Walkthrough has been revised to include notes on how to deploy the
basic web page onto the Internet using the Godaddy Server
Pluralsight -
Introduction to ASP.NET video - Using ASP.NET Web Forms
discusses creating a textbox, button and label controls
Open Visual Studio 2010
File → New Website
Installed Templates click Visual Basic and select
ASP.NET Empty Web Site
Note, I'm unable to get the ASP.NET Web Site to work on Godaddy
Web location select ftp and give it a name BasicWebSite
After clicking the Browse... button, uncheck the
Anonymous log on checkbox and then enter your godaddy ftp server
user name journeyeducati and password Normalschool1
Add a page to the Web Site
Solution Explorer → right-click on the Web Site name and then click Add
New Item
select Visual Basic under Installed Templates
click Web Form
Name: FirstWebPage.aspx
clear the Place code in separate file check box
click Add to create create a new web page. This will add a tab in the
document window and another entry in the Solution Explorer
Add HTML to the Page
HTML Page (.htm or .html) can be used to display static HTML in your
web site.
click the Design tab at the bottom of the document window so you
get a WYSIWYG display with a rectangle representing a div element/tag on the
page
click inside the rectangle and type the following:
Welcome to Visual Web Developer
save the page (this will automatically upload the file to the godaddy server)
View in Browser by right clicking anywhere on the page and selecting
View in Browser. Then a web browser like Internet Explorer will open and display
the web page.
Adding and Programming Controls
Click the Design tab
put the insertion point at the end of the Welcome to Visual Web Developer
text and press ENTER on the keyboard 5x to make room in the div element/tag box
Drag a TextBox control onto the page, in the middle
Drag a Button control onto the page to the right of the TextBox control
Drag a Label control onto the page and drop it on a separate line below the
Button control
Publish to the project folder, not the parent folder. Visual Studio will replace/delete
everything in the project folder with the files in Visual Studio. If you select the
parent folder, then you will have other files outside of the project deleted.
The Quick Tag Selector bar makes it easier for you to select, edit, and
remove tags while working in the Code or Design view of a web page
the Quick Tag Selector is found on the lower section of the Design view
pane.
When you put the insertion point anywhere on a page, the quick tag selector
displays a tag that shows the underlying HTML for that area. Tags that contain
the current tag appear to the left of the tag in the quick tag selector bar.
When you move the pointer over a tag in the quick tag selector, the tag's
content is highlighted in Design view and an arrow appears on the tag. You can
click this arrow to select a tag and its content, or to select only the content
of the tag.
"You can also use the ESC key to go up the hierarchy of elements. For example,
the h1 element is nested inside the div element of the banner. To select the
entire div element, click the h1 element to select it, and then use the ESC
key to select the banner div element. Note that the first time you press the
ESC key, it highlights the h1 element and shows the padding and margins
of the element. (Because you did not explicity set these, their values are
the default settings.) When you press the ESC key again, the entire div element
is selected. When the element is selected, the tag displays div#banner."
(.NET Framework 4 Walkthrough: Creating and Modifying a CSS File)
How to delete or remove a web project in visual studio
text - depricated, will be removed in future versions of SQL Server
ntext - depricated, will be removed in future versions of SQL Server
char - non-unicode (western-european). 1-byte per character.
nchar - fixed length and supports unicode (international character set), use when storing non-english text.
Stores 2 bytes per character, so double the size of char type
varchar - varchar(8000) is maximum specified length
nvarchar - variable length and supports unicode, use when storing any language
as text. nvarchar(4000) is maximum specified length
Exact Numbers
int -2 billion to 2 billion
smallint 32,768 to 32,767
tinyint 0 to 255
bigint ±263
money ±922,337,203,685,477.5808
smallmoney ±214,748.3648
decimal fixed precision (total digits stored) and scale (amount of digits
after the decimal point) (p,s). Example, decimal(9,2) can store a number
like this 1234567.89
numeric is the same as decimal, just there for backwards compatibility
Approximate Numbers
float(n)
real
Date and Time Data Types
date - just stores a date
time - just stores the time
datetime - stores both date and time but recommend using datetime2 instead
datetime2 - more accurate and takes less space than datetime type
binary
varbinary
bit
xml - can parse the XML
uniqueidentifier
user defined
timestamp - depreciated
image - depreciated, use varbinary(max) instead
Create SQL Server Database in Go Daddy Web Hosting Account
Log in to your Account Manager username jefferyjjensen password Normal
under the My Products section (scroll down a little on the page), click
the Web Hosting link
this creates a new tab, Web Hosting. Under the Control Center heading,
click the LAUNCH button to open a new web browser window
click the Databases section and then click SQL Server icon
click Create Database
complete the fields
SQL Server Database is the same as the User Name. Since this is on
a shared hosting account, will need to be unique for all accounts, not
just your own. logindbtestasp
passwords must contain at least one uppercase letter and at least
one number, e.g. Normal1
uncheck Windows file DSN (data source name) - centrally store your
database connection information. Unable to determine what this does when
checked.
check ASP Schema - check to install the predefined tables necessary to
create user authentication
If you leave ASP Schema blank, then will create a blank database
without any tables
Yes - Allow Direct Database Access. Then can use Microsoft
SQL Server Management Studio to remotely manage your hosting account
databases.
SQL Server Database/user name: itfunda (can only contain letters and numbers)
password: TrainerLastname1 (must start with a letter and contain a number)
SQL Server Version: 2008
Allow Direct Database Access: Yes
SqlConnect (.NET): Data Source=itfunda.db.6396153.hostedresource.com; Initial Catalog=itfunda; User ID=itfunda; Password=TrainerLastname1;
SQL Server Connect: itfunda and TrainerLastname1 (available if you click on
the Manage via web admin link in Go Daddy Hosting Control Center v2.11.0)
Visual Studio Web location: ftp://journey-education.org/wwwroot/itfunda.com/demo01
(will get an error unable to retrieve folder information from the server. (550).
if you forget to add a web project name like demo01)
www.myfunda.net jefferyjjensen@gmail.com password: normal
Cannot debug ftp website on Go Daddy, will get the following error message:
Pending setup may take up to an hour but my experience has been about
5 minutes.
click the pencil button to view the necessary Connection String
for ASP.NET
Manage via web admin link under Database Name. This will show what tables
where automatically created.
Hosting Control Center is your Go Daddy account username and password
SQL Server Connection is User Name: logindbtestasp and Password: Normal1
Test Connection in Visual Studio
Open Visual Studio 2010
View → Server Explorer
right click on Data Connections and select Add Connection...
Choose Data Source
select Microsoft SQL Server
enter the following
Data Source: Microsoft SQL Server (SqlClient)
Server name: logindbtestasp.db.6396153.hostedresource.com
check Use SQL Server Authentication
User name: logindbtestasp
Password: Normal1
check Select or enter a database name: logindbtestasp
click Test Connection button
click the Design view tab on a web page, for example Default.aspx, and drag
and drop a table from Server Explorer, for example aspnet_Users
onto the web page. This will automatically create a GridView control that is
connected to this database.
For some reason, I'm having problems when I create a new web site using visual studio.
I do the steps above but keep getting the server error in '/websites/itfunda.us' application
when attempting to display from Go Daddy server. It appears to be a login error. Edit the
SQL statement to include the full name, SalesLT.Customer instead of just Customer. I'm thinking
the naming convention is databaseName.schemaName.objectName or schemaName.objectName
Open SQL Server 2008 Management Studio. I also like to change the Environment
Layout from MDI to tabbed documents using Tools → Options... → and
clicking the Tabbed documents radio button.
Establish a connection to a SQL Server database. Each connection creates
a process id (procid)
Open an editing window by clicking New Query or the shortcut Ctrl-N on
the keyboard. Note, an editing window always requires a connection to the database.
Connection String
How do you copy a connection string from Visual Studio Server Explorer
into the web.config?
Connection Strings are stored in the web.config file
"The .NET Framework relies on .config files to define configuration options.
The .config files are text-based XML files."
"System-wide configuration settings for the .NET Framework are defined in the
Machine.config file... The default settings that are contained in the Machine.config
file can be modified to affect the behavior of .NET applications on the whole
system."
"You can change the ASP.NET configuration settings for a single application if
you create a Web.config file in the root folder of the application. When you do
this, the settings in the Web.config file override the settings in the Machine.config file."
"The following example shows a minimal Web.config file:"
web.config example
machine.config
unable to edit, only opens with read-only. Workaround is to right click on
UltraEdit and select Run As Administrator from the context menu (alternative
shortcut is to press Ctrl+Shift and then click on the program). Then will
be able to edit and save machine.config. See the following thread post by
lextm cannot edit machine.config file in windows server 2008,
tells me access denied
Windows 7 Control Panel → System and Security → Local Security
Policy → Local Policies → User Rights Assignment →
add local computer user name to the following Local Policy Object Display Names:
Backup files and directories
Debug Programs
Manage auditing and security log
Microsoft SQL Server Management Studio and Godaddy
Background: how do you use Microsoft SQL Server Management
Studio to connect to a SQL Server database stored on the Godaddy
servers?
Godaddy, contact Mandy in the President's Office (email: president@godaddy.com)
about proposal to develop training materials for Godaddy in exchange
for web hosting services.
In SQL Server Management Studio, connect to the Database Engine
server type, expand Databases, right-click a database, point to Tasks,
and then click Import Data or Export data.
Visual Studio → Server Explorer → right click on the table and select
Show Table Data from the context menu
SQL Server Stored Procedures
Ctrl+Spacebar to autocomplete in Visual Studio doesn't work with
Management Studio
two part name, schema name and field name
two part name, table name and field name, for example
SELECT employees.[first name], employees.[last name], employees.shift from employees;
Management Studio templates are similar to Visual Studio Snippets
How to create a stored procedure using SQL Server Management Studio
Open SQL Server Management Studio
in Object Explorer expand the following
adventureworknew.db.6396153.hostedresource.com (SQL Server 10.50.1765 - adventureworknew)
→ Databases → adventureworknew → Programmability →
Stored Procedures → right click and select New Stored Procedure
stored procedures can accept input parameter name like
@State
How do you view the results of a stored procedure?
press Execute or F5 function key doesn't work
need to pass a parameter so right click on the stored procedure and
select Execute Stored Procedure then type in a value in the
Execute Procedure window. Should see the results in the Results tab
of the main Management Studio window.
How do you assign an alias or variable for a database name in an SQL statement?
at the end of the FROM statement, use the AS operator and then give
the alias name
Reference
"Correlation names are temporary table names assigned in the FROM clause.
You can use correlation names when long table names make qualified column
names long or confusing. A correlation name can also be called a table
alias." (Murach's SQL Server 2008 for Developers, p. 125)
How do you return only the unique values from a select query?
select distinct [favorite color] from dbo.People;
How do you query null in SQL Server
Background - nulls are treated different than other values
in SQL Server which is why some database administrators do
not use them.
this works select distinct [favorite color] from
dbo.People where [favorite color] is not null;
this also works
select distinct [favorite color] from
dbo.People where [favorite color] is null;
this does NOT work, select distinct [favorite color] from
dbo.People where [favorite color] != null;
this will always return false
"When using IntelliSense, it's often helpful to enter the table name before
you enter the columns. That way, IntelliSense can include the column names
for the table in the completion lists." (Murach's SQL Server 2008 for
Developers, p. 68)
How to view a table using ASP.NET
Background - SqlDataSource Control
ASP.NET and SQL Server
How to view an SQL Server table in a web page using a DropDownList, GridView
and SqlDataSource Controls
How to view an SQL Server table in a web page using C# code behind
using asp:SqlDataSource
Background
What is the difference between using Data Source Controls and writing code
to access data directly using ADO.NET? see MSDN
ASP.NET Data Access Overview
Open a web page such as Default.aspx in visual studio
ensure the web.config has a working connection string
drag an asp:SqlDataSource control and an asp:GridView control onto the Default.aspx
web page in between the <div> tags
write the following C# code in the code-behind file
Code Blocks:
<script language="C#" runat="Server">...</script>
discouraged, better to keep the code separate from the HTML, for example
form.aspx to store HTML and form.aspx.cs to store C# code or
form.aspx.vb to store Visual Basic (known as code behind)
Render Blocks: <%=UserDetails%>
%= means to write out the value of the variable UserDetails
Server Controls:
<asp:Label id="lblHelloWorld" runat="server" />
most common
User Controls:
<acme:Header id="ucHeader" runat="server" />
ASP.NET Expressions:
<%$ ConnectionStrings: NorthwindConnString %>
Data Binding Expressions:
<%# Eval("DBFieldName") %>
add the following code in a code behind file like Default.aspx.cs within
a method like the Page_Load method
Text is written at the top of the page, before the HTML is rendered because
it is in the Page_Load method. When you view the HTML source in the browser,
it is even before the HTML tag. Recommend using the Label and/or Literal
ASP.NET control if you want to write to a web page.
Can enclose HTML tags in the Response.Write, for example
Web Server Controls - strongly typed programmable objects
HTML Server Controls - similar to regular HTML elements but you control them
on the server-side
Validation Controls - used to validate Web Form submissions
User Controls - custom controls such as headers, footers, and menus
Reference
ASP.NET Web Forms Features by Dan Wahlin with Pluralsight
Label Control
Visual Studio: View → Toolbox → Label. Drag and drop this control,
will create the following code <asp:Label ID="Label1" runat="server" Text="Label">
</asp:Label>
ASP.NET label control is converted into a HTML span tag <span> when
sent to the browser
all of these labels are equivalent. Note the HTML break tag <br> is
just used to add a new line and is not required by the ASP.NET label control
Can use code behind to change the label text property
How do I modify/control/set the text attribute of the Label control from the
code-behind C# file?
add the following code in a method such as the Page_Load event
IDName.Text = "some text";
How do I use CSS to format my text in an asp:Label?
Add the following in Visual Studio
ASP.NET will then convert the asp:Label control into this span tag
as see from the browser. Notice
the use of the CSS style parameter. Also notice the asp:Label parameter
name is NOT the same as the CSS style parameter name. This is a problem
if you know how to do something in CSS, need to learn an alternative
name in asp:Label.
How do I add a CSS style in a Label control from the code-behind C# file?
6. How to associate an asp:Label with a TextBox?
This is used to change the focus from one control to another. For example,
say we have a label control which is Name and a second control which is a
textbox where the end user needs to type in his name. By using the
AssociatedControlID property of the label control, if the end user clicks
the label instead of directly in the textbox, the focus will still go
to the textbox. This is a nice feature but not critical.
need to have read and write permission to the folder/directory on the
server where you want to upload the file
UltraEdit FTP file permission does not work with Go Daddy windows hosting
accounts. See UltraEdit Help → Open from FTP (File menu/FTP submenu).
"Permissions allows the file file permissions to be set on a remote file.
This will only work on servers that recognize the FTP 'Site' command
chmod. Typically this would only be UNIX/Linux servers."
Go Daddy FTP File Manager
check the folder, then click permissions
Problems using IE9 with Go Daddy FTP File Manager, recommend using Firefox
instead
The fileUpload control will overwrite an existing file, will not get a warning
ITFunda.com - ASP.NET How to Tips and Tricks, FileUpload Web Control, p. 87
Murach's ASP.NET 4 Web Programming with C# 2010, 4th Edition by Anne
Boehm and Joel Murach, How to use the file upload control, p. 244-5
Site Navigation
"ASP.NET's site navigation features are designed to simplify the task of
creating menus and other navigation features that let users find their way
around your web site. To implement these features, ASP.NET provides a site
map data source control and three navigation controls: TreeView, Menu, and
SiteMapPath." (Murach's ASP.NET web programming with C# 2010, 4th Edition by Anne Boehm and
Joel Murach, p. 338)
"... the SiteMapPath control, which creates a series of links that lead
from the application's home page to the current page. These links are sometimes
called bread crumbs because they let the user find his or her way back to the
home page. Unlike the TreeView and Menu controls, the SiteMapPath control
doesn't need to be bound to a data source. Instead, it obtains the site
navigation information directly from the web.sitemap file." (Murach's ASP.NET web programming with
C# 2010, 4th Edition by Anne Boehm and Joel Murach, p. 350)
Appears the SiteMapPath Control should be added to the Master Page
[Q] How do you sort links in the TreeView or Menu Control?
Menu Control
Web.SiteMap (Sitemap file)
"Before you can use one of the site navigation controls, you must create
a web.sitemap file in the application's root directory... you can
add a web.sitemap file to an application by choosing the Website → Add
New Item command and selecting Site Map from the list of templates... The
web.sitemap file can contain two types of XML elements: siteMap and siteMapNode."
(Murach's ASP.NET 4 Web Programming with C# 2010, 4th Edition by Anne Boehm
and Joel Murach, p. 340)
"In the Web.sitemap file, add a siteMapNode element for each page in your
Web site. Then you can create the hierarchy by nesting siteMapNode elements.
In the preceding example, the pages for Hardware and Software are child elements
of the Products siteMapNode element. The title attribute defines the text that
is usually used as link text, and the description attribute acts both as
documentation and as a tool tip in the SiteMapPath control." (MSDN ASP.NET Site Maps)
Web.sitemap file must be saved in the root level
References
Murach's ASP.NET 4 Web Programming with C# 2010, 4th Edition by Anne Boehm
and Joel Murach, p. 340
ITFunda.com - ASP.NET How to Tips and Tricks, Menu Control, p. 221
TextBox.TextMode Property - gets or sets the behavior
mode (single-line, multiline, or password) of the TextBox control
TextMode="Multiline" Rows="5" Columns"50" - this will create a multline textbox
that has 5 rows by 50 columns.
MaxLength Property - used to limit the number of characters entered by the user
ReadOnly Property - set to true, user can click in the textbox but cannot edit it
Enabled Property - set to false, textbox is disabled, dimmed color and the user
cannot copy the value
TextBox Control Questions and Answers
How do I prepopulated a TextBox with a default password?
Cannot be done, this is a security breach
9. How do I set and get the TextBox value?
Problem, if I use both Text and TextMode properties of the
TextBox, then the TextBox is disabled.
Need a TextBox ID in the Default.aspx file
add the following in the code behind, Default.aspx.cs
AdRotator Control
The asp:AdRotator control is enclosed/surrounded by what HTML element?
A normal image tag <img> doesn't have this. So it causes problem
when trying to add images to an existing web page, see the following
"The ListView control supersedes the Repeater control and the DataList
control. Existing pages that use those controls will continue to function.
The ListView control simplifies the implementation of many common scenarios."
(MSDN ASP.NET Data Access Overview)
SqlDataSource Control
Visual Studio → View → Toolbox → Data → SqlDataSource
Visual Studio Toolbox has several HTML controls. By default, these
are set to run at the client browser and not the server. If your using
code behind to manipulate a HTML control on the server, then you
need to add the parameter runat="server". If this is missing,
will not be able to see the HTML ID in the C# code behind file.
ASP.NET Master Pages
Provide a common page layout
Extend the UserControl class
Have a .master extension
Can have a code behind page
Define areas where content should be placed within the defined page layout
Master Page Directive Attributes
Inherits="MasterPage" this assigns a class name to the master page. See
MSDN ASP.NET Master Pages
Steps to creating and using Master Pages
Step 1. create the Master Page
"The master page and content page do not have to be in the same folder.
As long as the MasterPageFile attribute in the content page's @ Page directive
resolves to a .master page, ASP.NET can merge the content and master pages into
a single rendered page." (see MSDN ASP.NET Master Pages)
add ContentPlaceHolder server control, that is
<asp:ContentPlaceHolder id="ph1" runat="Server" />
recommend using head ContentPlaceHolder, just in case you want to add
some javascript or CSS that is unique to a page
"In general, when working with elements on master pages, it is recommended that
you use a server control, even for elements that do not require server code. For
example, instead of using an img element, use an Image server control. That way,
ASP.NET can resolve URLs correctly and you can avoid maintenance issues that might
arise if you move the master or content page." ((see MSDN ASP.NET Master Pages))
Step 3. create content page (.aspx)
Need 2 things
1. Page directive which includes the MasterPageFile attribute to bind the page
to the Master Page, <%@ Page MasterPageFile="a.master" %>
2. Content controls, <asp:Content />
"You define the content for the master page's placeholder controls by creating
individual content pages, which are ASP.NET pages (.aspx files) that are bound
to a specific master page. The binding is established in the content page's @ Page
directive, which binds it to the Master1.master page."
<%@ Page Language="C#" MasterPageFile="~/MasterPages/Master1.master"
Title="Content Page"%>
(see MSDN ASP.NET Master Pages)
"In the content page, you create the content by adding Content controls and
mapping them to ContentPlaceHolder controls on the master page. For example, the
master page might have content placeholders called Main and Footer. In the content
page, you can create two Content controls, one that is mapped to the ContentPlaceHolder
control Main and the other mapped to the ContentPlaceHolder control Footer...
After creating Content controls, you add text and controls to them. In a content page,
anything that is not inside the Content controls (except script blocks for
server code) results in an error. You can perform any tasks in a content page
that you do in an ASP.NET page. For example, you can generate content for a Content
control using server controls and database queries or other dynamic mechanisms."
(see MSDN ASP.NET Master Pages)
add Content server control, that is
<asp:content id="bodyContent" ContentPlaceHolderID="ph1" runat="Server">
Step 4. using a web browser, open the URL of the content page, not the master
page to view it. The master page becomes a part of the content page, not the other
way around.
Questions and Answers on Master Pages
A web site will only have one Master Page right?
Where do you save the Master.Page file? At the root level? Yes, but it can
be anywhere, just specify the path
What path (folder structure) is used for content pages, master pages and
standard HTML resources like image tags? Basically the paths in a master page
get resolved to the content page paths but make sure you use ASP.NET server
controls in a Master Page and not standard HTML controls which have paths. That
way ASP.NET can take care of the path resolution.
See ASP.NET Web Project Folder Structure.
Looks like you add the <div> tags into the Master Page
Do you use any of the ASP.NET special folders with Master Pages? No
Where do you save the content files for a Master page?
Cannot view a Master Page in the browser
What goes in a Master Page?
Need to use the Master Directive, similar to a Page Directive
"In addition to the @ Master directive, the master page also contains all of the
top-level HTML elements for a page, such as html, head, and form. For example,
on a master page you might use an HTML table for the layout, an img element
for your company logo, static text for the copyright notice, and server controls
to create standard navigation for your site. You can use any HTML and any
ASP.NET elements as part of your master page."
(MSDN ASP.NET Master Pages)
How do I have a master page for each <div>, for example a master
page for the header, footer, left navigation and right content? Currently,
I would have to have the header, footer and left navigation static in
the master page and can only change the right content with a content page
like default.aspx? Answer, you don't use UserControls instead
"When you work with standard HTML, it's a common practice to store the global
formatting information for a web site in an external style sheet...Then, you
can apply the styles in this style sheet to all pages of the application. Although
this works well for HTML elements, it can be tricky to get this to work
correctly with ASP.NET server controls because it requires that the programmer
and web designer understand how server controls are rendered to HTML. The solution
to this problem is to use themes, which lets you specify the formatting for both
HTML elements and server controls." (Murach's ASP.NET 4 Web Programming with C#
2010, 4th Edition by Anne Boehm and Joel Murach, p. 358)
Skins are used to define the appearance of ASP.NET server controls, but I thought
CSS can do this as well. So what is the advantage of using Skins.
"Only one theme can be applied to each page. You cannot apply multiple themes
to a page, unlike style sheets where multiple sheets can be applied."
Skin files are stored in the ASP.NET folder App_Themes and have a name
of filename.skin
Recommend using the SkinID instead of a default skin, that is one that is applied
to all ASP.NET server controls.
It appears Intellisence doesn't work with skins
Need to use the Theme attribute of the Page directive in order to apply a
a theme to a page
How to use skins for ASP.NET controls in a theme
Step 1: create a special ASP.NET folder called App_Themes. Do this my right
clicking on the root web application and selecting
Add ASP.NET Folder → Theme. Then enter a name for the theme.
Step 2: right click on the App_Themes folders and select Add New Item.
Select Skin File
Step 3: edit the skin file
appears Intellisense doesn't work with skins
named skin, recommend always using a SkinID to avoid maintenance problems in the future
default skin doesn't have a SkinID, again this is discouraged
Option 1: copy a Web.config file in the directory where your KML/KMZ files will be served.
According to Godaddy tech support, only have the edit the web.config at the root level, this
will take care of all subdirectories so you do not have to have a web.config in each and every
directory you want to serve up the a non-standard file (e.g. KML/KMZ)
Example Web.config file:
Windows Internet Explorer WebControls is a collection of ASP.NET server controls
for four popular user interface elements:
MultiPage, TabStrip, Toolbar, and TreeView
Hello World example using ftp Godaddy web hosting, Visual Studio 2008 and ASP.NET 3.5
Open Visual Studio 2008 and Create a New Web Site using ASP.NET,
location FTP, godaddy server (ftp://journey-education.org/wwwroot/vs2008),
and language Visual C#
Login to the Godaddy Web Hosting ftp server
Add the "hello world" text to the Default.aspx file
Test the webpage. Will get the following error
Delete the <authentication mode="Windows" /> tag from web.config file
Save the web.config and Default.aspx files (Visual Studio 2008 should automatically
ftp these files up to the Godaddy server). Then open a browser and view the file:
New or Open existing website using ftp Godaddy web hosting, Visual Studio 2010 and ASP.NET 4.0
Step 1a - Open Visual Studio 2010 and Create a New Web Site using ASP.NET,
location FTP, godaddy server (ftp://journey-education.org/wwwroot/vs2010),
and language Visual C#. Remember, as of August 2010, godaddy started supporting ASP.NET 4.0.
Step 1b - New Web site
Visual Studio: File → New Web Site
In the New Web Site dialog box, in the left-most Location list, click
FTP Site and then click Browse.
After clicking the Browse... button, uncheck the
Anonymous log on checkbox and then enter your godaddy ftp server
user name journeyeducati and password Normalschool1
Login to the Godaddy Web Hosting ftp server
If opening an existing website, will get this dialog box, just check
the Open the existing Web site radio button
If the connection is successful Visual Studio displays the FTP web site name in the Solution
Explorer and lists the files that are already in the FTP Web site.
The rest is the same as Visual Studio 2008 and duplicate for your convenience
Test the webpage. Will get the following error
Delete the <authentication mode="Windows" /> tag from web.config file. Visual
Studio will default to Windows Authentication when creating an empty web site. If
using ASP.NET web site template, then Forms Authentication is used.
Save the web.config and Default.aspx files (Visual Studio 2010 should automatically
ftp these files up to the Godaddy server). Then open a browser and view the file:
Cannot install FrontPage Server Extensions on IIS7, will get the following
error message
Might get the following warning message, click no since Godaddy doesn't support .NET 4.0
as of July 2010
How to edit the Base URL of a web site in Visual Studio
Solution Explorer → right-click the Web site name and then click
Properties Pages. On the Start Options tab, under Server, click Use custom
server, and then in the Base URL box, type the location
(see MSDN Walkthrough: Editing Web Sites with FTP in Visual Studio
Visual Studio Line Numbers
How to display line numbers in visual studio?
Visual Studio 2010:
Visual Studio 2008: Tools -> Options -> Text Editor -> All Languages: check the
Line numbers checkbox
Recommend just having a single web.config at the parent or root level
instead of having mulitple web.configs in each child or sub-folder.
There isn't a test connection feature available with a web.config,
will have to write code to see if the connection works. This is why I
like using the Server Explorer Data Connections wizard where you
have the ability to test the connection. See lecture notes on
Create SQL Server Database in Go Daddy Web Hosting Account
Visual Studio and Expression Blend - 3D graphics of projections
Visual Studio and Google Apps
Visual Studio and Google Maps Data API
Commenting Code
"In VB.NET, you can only comment out one line at a time using the tick (')
character that you place in front of the text that you want to use as a '
comment."
"To comment a single line in C#, you use two slashes (//). Additionally,
you can use /* and */ to comment out an entire block of code in C#."
(Beginning ASP.NET 4 in C# and VB by Imar
Spaanjaars, Publisher Wrox, p. 179)
Writing XML Comments. "All you need to do is position your cursor on the line
just before a class or method and type ''' (three tick characters) for VB or
/// (three forward slashes) for C#. As soon as you do that, the IDE inserts
XML tags for the summary and optionally the parameters and return type of
a method." (Beginning ASP.NET 4 in C# and VB by Imar
Spaanjaars, Publisher Wrox, p. 180)
Microsoft Certified Technology Specialist (MCTS)
Exam 70-515: TS: Web Applications Development with Microsoft .NET Framework 4
Course 10264A: Developing Web Applications with Microsoft Visual Studio 2010 -
Sept 16, 2010
ASP.NET Courses
CSN - CIT 152: Dr. Brodersen
syllabus Spring 2011 JavaScript and ASP.NET course. Problem
is this is an online class, no direct instructor interaction.
"You're advised not to prefix your variables with a few letters to
indicate the type. For example, write firstName and not
sFirstName for a String holding someone's name. This type of
notation, called Hungarian Notation, is considered outdated. IDEs
like VWD, with their smart IntelliSense and other programming tools, don't
really require this anymore. Without Hungarian Notation, your code becomes
easier to read (age is more readable than iAge) and easier to maintain
because you can change a variable's type without renaming it everywhere it's
used."
(Beginning ASP.NET 4 in C# and VB by Imar Spaanjaars, Publisher Wrox, p. 142)
"Youll notice that the preceding examples dont use variable prefixes. Many
longtime programmers are in the habit of adding a few characters to the start
of a variable name to indicate its data type. In .NET, this practice is
discouraged, because data types can be used in a much more flexible range
of ways without any problem, and most variables hold references to full
objects anyway. In this book, variable prefixes arent used, except for
web controls, where it helps to distinguish among lists, text boxes, buttons,
and other common user interface elements. In your own programs, you should
follow a consistent (typically company-wide) standard that may or may not
adopt a system of variable prefixes."
(Beginning ASP.NET 4 in VB 2010 by Matthew MacDonald, p. 20)
"A validation error does not prevent the page from running. It simply provides
you with feedback that the markup in the page does not conform to the current
browser schema." (MSDN
Markup Validation in Visual Web Developer)
"Validation is a distinct operation from generation. When you work in
the designer, Visual Studio adds, or generates, markup to the page. The
markup created by the designer is not determined by the current browser
schema. Instead, the Web page designer in Visual Studio always generates
XHTML 1.1-compatible markup." (MSDN
Markup Validation in Visual Web Developer)
"Validation checks the markup of the page in the designer. It cannot
guarantee that the when the page runs in the browser, the output of the
page will validate against a specific schema. Individual ASP.NET server
controls and the page itself render markup, and sometimes script, into
the page when the page is processed. That output is not accessible to
validation in the designer." (MSDN
Markup Validation in Visual Web Developer)
"If you want to make a page conformant to XHTML standards, you should
do all of the following:" (XHTML in Visual Web Developer)
ASP.NET Online Classroom Training - Complete Web Development Training
delivery mode is Microsoft live meeting or WebEx. Cost is $159 during
India time zone or $233 other time zones.
Sheo Narayan (9:30pm India Time, 9am PST)
Introduction to ASP.NET by Jeffrey Kent, www.ed2go.com
"If you have access to a Web host, you're welcome to use it for this
course. However, I won't be able to help you with uploading your files to
the host, nor will I be able to help you configure the host. So, I recommend
you use the Web server software that's on your own computer."
(Introduction to ASP.NET by Jeffrey Kent, Lesson 1, Chapter 3)
The Web and ASP.NET. Discover how a Web server can create and send
dynamic files to a browser, install the free ASP.NET tool, and learn
a bit of HTML.
Buttons, Text Boxes, and Postback Mode. Build a complete Web program
that accepts a user's name and prints a friendly message displaying it.
Classes, ListBoxes, and Event Handlers. Create an interactive form
that allows users to add items to a ListBox and to check which item
is selected.
Images, Styles, Check Boxes and Radio Buttons. Add images, different
fonts and background colors, check boxes, and radio buttons to your
application.
Variables, Calendars, and Databases. Explore variables and databases
as you build a Web site that displays a calendar control.
Retrieving and Displaying Data in a Grid and Form. Make a Web site
that displays data from a database and lets users modify the data.
Form Views and Relational Data. Display single rows of data using
FormView control, and relate data between tables.
Relational Data and Repeaters. Join tables using a Query Builder
tool, and display multiple rows of data with custom formatting.
Master Pages, More Repeaters, and Query Strings. Create a master page
and pages that use it, and use a Repeater control to provide links to
a details page.
Building a Community Web Site. Begin developing a multipage community
Web site.
Login Controls. Create the pages for the membership site, including
the login form.
Security, Page Transfers, and Where to Go Next. Delve into various
security issues and find out how to transfer between pages.
UNLV Continuing Education Course - Introduction to Visual Studio 2010 and ASP.NET 4
Class 1
Godaddy - Register a domain name
Godaddy - Setup web hosting account
Godaddy - Setup ftp
Download and Install - .NET Framework 4
Download and Install - Visual Studio 2010
Download and Install - SQL Server Management Studio
Create a Basic Web Page in Visual Studio
References
MSDN Walkthrough: Creating a Basic Web Page in Visual Studio
Members of a class include its properties, methods, constructors and events
Property
Method
What is the namespace for the static method Math.Sqrt(number)?
Just use using System; since the System.Math is already included
in the mscorlib.dll, that is the System Namespace.
Math Class
Future Topics
what is the difference between <asp:Label ID="Label1" runat="server" Text="www.ccsdecs.com"></asp:Label>this is created when you drag and drop a label control onto an .aspx page <asp:Label ID="Label1" runat="server" Text="www.ccsdecs.com" />
How to make breakcrumb trails or tree view control or web site map (xml) file
Master Page (Templates)
How to change themes/skins using CSS
Open Designs - Overall is a 4 column, fluid width template