Sunday, January 27, 2008

Web Design, Development, Search Engine Optimization and Programming

Web Design, Development, Search Engine Optimization and Programming

1. Binding to ArrayList or HashTable you create in code
A. ArrayList: Binds one field, displays in order created
1. Dim alAlpha As New ArrayList()
2. alAlpha.Add("Larry")
3. …
With radiobuttonlistAlpha
.DataSource = alAlpha
4. End With
5. …
6. radiobuttonlistAlpha.SelectedItem.Text
B. HashTable: Binds two fields (nice!), but displays in own hash order.
1. Dim htAlpha As New Hashtable()
2. htAlpha.Add(“27”,”Larry”) ‘(key,value)
With rblAlpha
.DataSource = htAlpha
.DataTextField = "Value"
.DataValueField = "Key"
3. End With
C. Folder: Binds to the directory info object
1. Dim dirInfo As New DirectoryInfo("path to folder")
With rbtFilesList
.DataSource = dirInfo.GetFiles
.DataTextField = "Name"
.DataValueField = "FullName"
End With
2. CheckBoxList & RadioButtonList (hint. Think Check Box Repeater….)
A. Allows you to bind a data source to a “group of boxes or radio buttons”
B. Check boxes allow more than one choice
C. Radio buttons allow only one to be selected from the group.
D. Both use standard binding code.
1. Example bind to datareader.
With rblEmployees
.DataSource = dr
.DataTextField = "Name"
.DataValueField = "EmployeeID"
2. End With
3. Formatting:
A. Easy…check the properties….cols, table, vertical vs horizontal.
4. Get “selected values”
A. RadioButtonList: Items collection is all the buttons…selectedIndex is the index of the one that is selected….so you get the Item (button) selected
1. Then return the property you want from that item…ie .Value
2. rblEmployees.Items(rblEmployees.SelectedIndex).Value
B. CheckBoxList…have to loop through and see what is selected
For intCnt = 0 To cblOrders.Items.Count - 1
If cblOrders.Items(intCnt).Selected Then
Do something with … cblOrders.Items(intCnt).Value)
End If
5. Calendar: Cool but costs lots of screen real estate.
A. Right click to Auto format
calBirthdate.SelectedDate = CDate(dr("BirthDate"))
calBirthdate.VisibleDate = CDate(dr("BirthDate"))
B. .SelectedDate is date the user selects but set but does not automatically show that date.
1. .VisibleDate is the date to display. You have to set both
C. calBirthdate_SelectionChanged event is triggered when user selects a new date.
1. This is where code goes to save the date.
6. AdRotator Control
A. Displays new image with each rendering
B. Key is the XML Advertisement file you hand write.
1. photo to show
2. is where to go if you click on the picture
3. text if no images permitted or tool tip
4. relative frequency to show this image
5. used to filter which ones to show.
C. Tip…copy the sample xml and modify
D. Set the .AdvertisementFile property to that xml file and it’s good to go.
E. Hint: Picture is stretched to fit the control.
7. Placeholder and Literal control
A. Takes place of old DHTML’s insertAdjacent etc… builds content the fly.
B. Literal control: used in code to hold HTML text “object”
1. Dim lit As New System.Web.UI.WebControls.Literal()
2. lit.Text = "

C. Placeholder control: An invisible box (container) to hold controls you create on the fly.
D. Following code is a sub routine to add a hyperlink control if you supply the URL, Display Text and control ID.
Private Sub MakeLink(ByVal URL As String, ByVal Text As String, ByVal ID As String)
Dim hyp As New HyperLink()
Dim lit As New System.Web.UI.WebControls.Literal()

With hyp
.NavigateUrl = URL
.Text = Text
.ID = ID
End With

lit.Text = "

1. End Sub

Sunday, January 20, 2008

Huntington Beach web design and development california in ASP.NET

Huntington Beach, california web design and development in ASP.NET

1. User Control
A. Like include files.
B. Reusable chunks of code.
C. End with .ascx
D. Drag onto any page
E. Change the control…all the pages change.
F. Change the location of the page…ouch..change the scr in the directive.
2. Custom Control
A. Appear in toolbox…more complex…it’s a DLL
B. Not this semester
3. Add New Web User Control
A. Design then drag onto other pages.
4. You can create properties for a control
A. And set those properties in the code of the page you drag it on.
5. To access properties and events of user control
A. You have to add the declare at the top of the form.
B. Protected WithEvents ddlList As System.Web.UI.WebControls.DropDownList
1. (this is automatically done for standard controls, you have to type it for your user controls.)
6. Placing a Control on a page creates a directive at the top of the HTML page
B. Delete the control does not remove this
7. At the location of the code a tag referring to that control
1. note how uc1 refers to the tagprefix in the Register
2. If you add another instance it refers to the same register
B. KEY Point. If you have control properties….they become tag attributes of the tag in HTML view…important.
8. The UC contains and hides it’s composite (child) controls
A. User does NOT have access to the controls inside the UC
1. The properties of internal controls on the UC are invisible outside the control
B. You must “Expose” or Map any properties on the internal controls back to the outside so you can access them….Easy
9. Exposing Properties on your control: Easy
A. Create a Public property the same name as built in property of a server control on the user control
B. Set the value of the property of the server control to the value of the public property you exposed.
10. Four steps to Exposing Custom events with User Controls
A. 1st in the User Control; Declare (expose) the event
1. Public Event MySelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
2. Use the same arguments as all events…
B. 2nd in the User Control find an existing event and add the following code…
1. RaiseEvent MySelectedIndexChanged(sender, e)
a) This will trigger your custom event from inside your control
C. 3rd Delcare WithEvents on the Form where the user control is added:
1. Protected WithEvents ddlCategories As DataDropDownList
D. 4th Find the control on the drop downlist of controls and code for the event you exposed when designing the user control

Sunday, January 13, 2008

Data Reporting Crystal reports software Development in Irvine California

Data Reporting Crystal reports software Development in Irvine California
1. Data Reporting
A. Reports turn data into information
B. Crystal Reports is a popular report writer (banded reports)
C. VS.NET provides Crystal “light” integrated into UI
1. My best guess is Crystal version 8 with VS 2000
a) Crystal 9 with VS 2003
2. Upgrades from the Business Objects web site.
2. Note that Crystal is an option during installation.
A. Adds the CrystalDecisions Namespace
3. Big Picture
A. Crystal provides
1. The Crystal Designer Form.
a) Used to create the report
b) Can use the full version instead
2. The Crystal Viewer Server Control
a) Server side report viewer
b) Not needed if using the PDF format
3. The CrystalDecisions Namespace
a) Used to programmatically manage Crystal
B. When you Create or Add a Crystal report to the project
1. It creates an associated .vb file with the Class
C. If you change the Report outside of VS
1. Recompile to update the DLL from the VB.
D. You can NOT test a VS.NET report directly…you must create web page and load the report into a viewer or create a PDF.
1. Good reason to consider using the full version.
4. Steps (remember the right mouse button)
A. Add New Crystal Reports.rpt
1. Name and Design the report
2. Tips on using the Crystal Designer
a) Report is based on sections
b) Detail section is repeated for each row
c) Header/Footer sections repeat on each page.
d) If you add Groups then you get group sections
e) Group allows you to break and subtotal
B. Add a new Web Page then….
1. Drag on Crystal Web Viewer control
2. And bind the viewer to the Report
5. Dealing with Logon failure due to password on SQL account:
A. Using > version 9 you need to login into each table
1. See attached commented code.
B. Version 9 > use report.SetDatabaseLogon() method
1. In theory Crystal 9 supports a SetDatabaseLogon method…
6. Other interesting Crystal Issues.
A. You can use the Full crystal designer to create the reports and then add to your project with AddExisting
1. VS will create the appropriate .vb files
B. IF you change your Report you have to rebuild the project even if you do not change code…because changing your report requires changes in the report class
C. PDF is fine for smaller reports but rumor has it that large (hundreds of pages) can be a problem.
7. Future: SQL Reporting Services will be built into .NET
A. Provides similar reporting but completely written and integrated into .NET
B. Used just for SQL Server
C. Requires Full SQL Server