Tuesday, May 31, 2011

Introducing HTML 5

Finally I finished my first HTML 5 reading. My very first book about such important topic was "Introducing HTML 5" by By Bruce Lawson and Remy Sharp (http://introducinghtml5.com/).
What I should say about the book... First of all, I choose this book because of good Internet reviews. Several websites suggested that if you’re looking for a nice, readable, non-stuffy, example-rich book to help you get started with HTML 5, please check out Bruce Lawton’s and Remy Sharp’s "Introducing HTML 5" For a second, the same sites listed areas of coverage of HTML 5 in the book, which was very interested to me. So, I was intrigued by the book.
The book successfully and intelligently covers the news things in HTML5, offers meaningful examples and provides a link between old world (HTML 4) and new world (HTML 5). It's not strictly manual. I would say, it's author's presentation of new version of the language, which covers certain areas for as many as possible browsers including a mobile ones. It gives overall conception for those who used to deal with HTML4 and tries to learn HTML 5. Definetely it's a book for experienced technical professionals. Personally I want to know how HTML 5 will work in multi-browser world. In recent years we have a choice to choose a browser and device to surf, but we did not have a choice in language. It looks to me, HTML 5 does a good work for multi-platform Internet word.
Definetely I would recommend this book for pro.

Thursday, May 26, 2011

SEO (several tips)

1. Very often people ask me the same question "Where to get some publicly available info about their website?"
and my very first answer is www.alexa.com . Using www.alexa.com, you can find Alexa Traffic Rank, link popularity, top sites by country or by category, search analytics, and audience. It's quite full picture for someone who is anxious about how his/her website is doing in Internet community.

2. What is Link popularity? It's new Internet-based terminology, but it has old meaning for those who like to make friends in life.
So according to Google, "link popularity refers to the number of hyper-links pointing to a page on the Web." Link popularity assumes that NOT all inbound links are equal.
How to check you linkage? I prefer www.linkpopularity.com . I'm sure you can find on Internet more tools to measure your site link popularity and all of them equally good.
They will give you a picture who is talking to you on Internet, who uses your info and who refer the traffic to you site.

3. Link exchange program. There are a lot of sites which offer this service to site owners. Personally I don't recommend to use these programs. Make a friends in Internet community by yourself. I know it's not easy, but it's possible.

Good luck!

Monday, May 23, 2011

ASP.NET Reset button to clear form fields

As per me there is no such reset functionality provided by Asp.Net. So, I decided to research anything about possible solution. One thing what I have tried was a server-side routine such as

For Each ctrl As Control In Me.Controls
' clean up the textboxes
If TypeOf ctrl Is TextBox Then
DirectCast(ctrl, TextBox).Text = String.Empty
End If

' clean up the checkboxes
If TypeOf ctrl Is CheckBox Then
DirectCast(ctrl, CheckBox).Checked = "False"
End If

'clean up dropdown lists
If TypeOf ctrl Is DropDownList Then
DirectCast(ctrl, DropDownList).SelectedIndex = -1
DirectCast(ctrl, DropDownList).Text = String.Empty
End If
Next
This idea did not work out at all and I moved to javascript-based solution. I found 2 choices. One of them to add a code
ResetQuote.Attributes.Add("onClick", "document.forms[0].reset();return false;"). I tried and this did work out at all. therefore I choose the last possible solution. It's elegant and Front-end solution. It did not take any of server resources. here it is:
<asp:Button id="btnReset" OnClientClick="this.form.reset();return false;" runat="server" Text="Clear Form">
Magically this idea works very well. From application stand point, this is the ideal solution in a way to implement button "reset/clear form". I hope, it will work for you.

Tuesday, May 17, 2011

Adding Client-Side Message Boxes in ASP.NET Pages

Today I learned about option for LinkButton "onclientclick" This option gives me a chance to execute a javascript function directly from asp.net page. Here's an example

<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False"
CommandName="Delete" Text="Delete" onclientclick="return confirm('Are you sure you want to delete?');" />

We can reach the same effect using code-behind:

Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
If (Not Page.IsPostBack) Then
Me.DeleteButton.Attributes.Add("onclick", _
"return confirm('Are you sure you want to delete?');")
End If
End Sub

It's quite interesting how asp-net works with javascript

Section 508

Many people has no clue about "section 508". I would like to spend some time and blog about this topic. For developers who used to develop a lot of front-end screen "section 508" becomes one of the important issues. First of all, there are number of sites dedicated to such important topic. Here are two of them:
section508.gov
HHS about section 508

Recently I did one special project dedicated to section 508. I worked on SRTR.ORG
I would like to share some guidelines from section 508 acceptance list.

- Checked for Description and Title Metadata, inserted Copyright Status
- Checked all URL’s contain the correct hyperlink, displayed the fully qualified URL and all URL's linked to the correct Web destinations
- Inserted in all images, grouped images and non-text elements that convey information ALTERNATIVE text descriptions
- Checked if all complex images have descriptive text immediately after the image
- Checked if all data tables in the document have a logical reading order from left to right, top to bottom
- Checked all documents file name not contain spaces or special characters. It's quite important for cyber security.
- Checked if document is free of scanned signatures because scanned signatures within documents are a considered a theft-of-identity risk

Full section 508 acceptance list could be find on Webaim

Monday, May 16, 2011

ASP.NET - Limit number of characters in TextBox control

I researched Internet and found a perfect solution . I would like to copy the solution into my blog for future references.

Here it is:

1. Create folder Scripts and file JScript.js in it. Copy and paste this code into it.

function validateLimit(obj, divID, maxchar) {

objDiv = get_object(divID);

if (this.id) obj = this;

var remaningChar = maxchar - trimEnter(obj.value).length;


if (objDiv.id) {
objDiv.innerHTML = remaningChar + " characters left"; }
if (remaningChar <= 0) {
obj.value = obj.value.substring(maxchar, 0);

if (objDiv.id) { objDiv.innerHTML = "0 characters left";}
return false;
}
else
{ return true; }
}

function get_object(id) {

var object = null;
if (document.layers) {
object = document.layers[id];
} else if (document.all) {
object = document.all[id];
} else if (document.getElementById) {
object = document.getElementById(id);
}
return object;
}
function trimEnter(dataStr) {
return dataStr.replace(/(\r\n|\r|\n)/g, "");
}

2. Create aspx-page and insert a code below:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Without master page</title>
<script type="text/javascript" src="Scripts/JScript.js" ></script>
</head>
<body>
<form id="form1" runat="server">
<div id="lblMsg1">240 characters left</div>
<asp:TextBox ID="TextBox1" runat="server" Height="50px" MaxLength="240" TextMode="MultiLine"
Width="600px" ToolTip="Summary:(240 characters)"
onkeyup="return validateLimit(this, 'lblMsg1', 240)"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1" Display="Dynamic"
SetFocusOnError="True">*</asp:RequiredFieldValidator>
<br /><br /><br />
</form>
</body>
</html>

3. Test the aspx-page.

Friday, May 13, 2011

HTML-code

Recently I began experience some difficulties to insert "raw" HTML code in blogger-window. The problem was that HTML code did not show up under browser as HTML code because all tags were executed. I still want to show some code in my blog. Therefore I searched Internet for the answer. And I found very easy and appropriate solution: replace all "<"-signs to and all ">"-signs on

I tested and it works. Now I can insert some "raw" code. Thanks Mr.Internet for a good tip.

Tuesday, May 10, 2011

Error:


Error Message: "Cannot insert the value NULL into column; column does not allow nulls"

The code, I have written, tries to insert NULL into column, which does not allow nulls, and column is a primary key one.
Solution:
- set up "Data type" as "int" for the column
- set up Identity Specification to Yes (see image)
- test the code

Monday, May 9, 2011

Sharepoint (first steps)

Next project. What should you do facing a new and challenging project? How to "attack" new assignment?
I know, I can get many suggestions and all of them would equally good and promising. Also I think, one of the suggestion would be to get as many as possible self-help books and read, read, and read...
Taking this advice, I have already choosen 3 books for initial reading. Here they are:
- "Inside Microsoft SharePoint 2010" by Ted Pattison
- "Sharepoint 2010 all-in-one for dummies" by Emer McKenna
- "Sharepoint 2010 Development with Visual Studio 2010" by Eric Carter
So far , I did not find a good tutorial online for beginners. I would be more than happy if someone will help me with this task (!)
I have already read first chapter of "Sharepoint 2010 all-in-one for dummies". It's quite good and informative. Now I'm taking another book "Sharepoint 2010 Development with Visual Studio 2010" and begin my reading. I hope to enjoy it. Also I'm taking some steps to learn more about HTML 5.

Saturday, May 7, 2011

ASP.NET (ask question)

Sooner or later all of us have questions without answers. Where to find reliable answers? There are lot of ways and one of then is Forums on ASP.NET.

Friday, May 6, 2011

Spokeo.com

Here's my first blog-entry about sites we should know and use. In a future I plan to add new sites for public use.

Spokeo.com

Additional info about site

Beginning ASP.NET 4: in C# and VB

Beginning ASP.NET 4: in C# and VB (Wrox Programmer to Programmer)
Imar Spaanjaars

Here's my first computer book I have read this year. It's good and "must have" book. I did not read a previous one and was a bit skeptical about this book. Truthfully speaking, I'm always skeptical about computer books because for me many of them are so outdated.
This book is quite different. Actually I learned a LOTS in the book even if its a starting book for ASP.NET. This is the first time I read a WROX book and I am impressed! before choosing the book, I took some time and read feedback about the book on www.amazon.com Here some of the best responses:

  • Lots of great examples step by step with a section that explain you the whole process each time.

  • Code are written in both C# and VB.NET.

  • Very comprehensive writing. The author explain everything and make things clear!

  • Very informative even if you are an advanced user in ASP.NET.

  • The book cover a nice project which go from a subject to another easily.

  • Cover LOTS of subject, even cover AJAX and JQUERY.


I hope, you will enjoy this book as much as I did. Definitely I recommend this book for those who are heavily involve in software development using Microsoft technologies.
I found very useful author's web site imar.spaanjaars.com

Thursday, May 5, 2011

Time-dependent Hyperlink (VB.NET)

1. Open up Visual Studio 2010.
2. Create web-form and name it default.aspx
3. Drag Hyperlink-element from toolbox and place on a page between body-tags.
Give ID="HyperLinkTime"
Save the form.
4. Open up code-behind page Default.aspx.vb and place some code on Page_Load
'Time-dependent hyperlink
Dim DateStart As Date = "3/1/2011 12:00AM"
Dim DateEnd As Date = "6/1/2011 12:00PM"
Dim DateNow As Date = System.DateTime.Now

Dim result1 As Integer = DateTime.Compare(DateNow, DateStart)
Dim result2 As Integer = DateTime.Compare(DateNow, DateEnd)

If (result1 > 0) And (result2 < 0) Then
HyperLinkTime.NavigateUrl = "http://www.yahoo.com"
HyperLinkTime.Text = "Yahoo.com"
Else
' Do nothing
End If
Save and test.
Hyperlink "Yahoo.com" will show up only between 3/1/2011 and 6/1/2011. The dates can be changed any time.

Hello World!

If you want to become a better programmer, start blogging!