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.