Portal
SubSite A
SubSite AA
SubSite AAA
SubSite B
SubSite BB
SubSite C
SubSite CC
SubSite CCC
Tune your C# knowledge. Masoud Tabatabaei 's daily note about .NET
Portal
SubSite A
SubSite AA
SubSite AAA
SubSite B
SubSite BB
SubSite C
SubSite CC
SubSite CCC







Click here to read the rest of the article:
http://mikeknowles.com/blog/2009/05/17/AddGoogleAnalyticsToASharePointPublishingSite.aspx
During my last workshop class on ASP .NET we had a review on web page design with ASP .NET. One of the most important part of the design is positioning the element inside you web site. What I recommend is to use <div> and <span> element with CSS styles to position your web pages instead of <tables>. If you look at the many professional designed web sites (like yahoo,msn, ...) and check their source code you will be noticed that most of them are using <div> or <span> for their pages. If you want to know why? "Table vs CSS" is are the reasons.
Sometimes, you may need to find which item of your CheckboxList is selected and get it's value on client. Normally ASP .NET CheckboxList does not send its item 's value to client. So if you want to have it, you have to added it your self. In this post I 'm going to show you a simple way to get selected checkbox list item 's value.
First I prepared a checkbox list with some items. In this sample I have added some item manually but you can do this using DataBinding.
<asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatLayout="Table">
<asp:ListItem Text="Test" Value="110" />
<asp:ListItem Text="Test2" Value="220" />
<asp:ListItem Text="Test3" Value="330" />
<asp:ListItem Text="Test4" Value="440" />
</asp:CheckBoxList>
Next, I have to add items value as an attribute for the items:
protected void Page_Load(object sender, EventArgs e)
{
foreach (ListItem li in CheckBoxList1.Items)
li.Attributes.Add("mainValue", li.Value);
}
Finally, you need to assign a function as click event handler for items. The point is that you can not do it just like the other html element on your page. So I will write a few line of code to add this event handler.
<script>
function AddHandler()
{
var tbl = document.getElementById('<%= CheckBoxList1.UniqueID %>');
for(var i=0;i<tbl.cells.length;i++)
{
var cell = tbl.cells[i];
cell.childNodes[0].onclick = function ()
{
if(window.event.srcElement.checked)
alert(window.event.srcElement.parentNode.attributes["mainValue"].value);
};
}
}
</script>
Notice that I will call this function ("AddHandler") on onload on body.
<body onload="AddHandler();">
The only thing that you have to be carefull is that this codes will work when you are using CheckboxList with RepeatLayout property is "Table".
Download the sample code from here:
http://www.tabatabaei.info/csharpsamples/EventArgsSample.rar
If you've ever collaborated with other people on a project, you know the frustration of constantly swapping files. Some do it by email, some through file upload services and some by other methods. It's a pain in the neck, and every designer and developer knows it. Revision control is an excellent way to combat the problem of sharing files between workers.
Most web-developers have probably worked with some sort of revision control system, but designers may find it a foreign concept. The most obvious benefit of using revision control is the ability to have an unlimited number of people working on the same code base, without having to constantly send files back and forth.
But designers and developers can both benefit from using revision control systems to keep copies of their files and designs. You can instantly browse previous "commits" to your repository and revert to earlier versions if something happens.
This article reviews some of the top open-source version control systems and tools that make setting up a version control system easy.
CVS is the grandfather of revision control systems. It was first released in 1986, and Google Code still hosts the original Usenet post announcing CVS. CVS is the de facto standard and is installed virtually everywhere. However, the code base isn't as fully featured as SVN or other solutions....
Read the rest of this article on :SmashingMagazine.com