Creating ASP.NET Applications with N-Tier Architecture

a good tutorial on N-Tier architecture introduction.

http://www.codeproject.com/Articles/439688/Creating-ASP-NET-application-with-n-tier-architect

Select All and Deselect All Checkboxes in a list Using Asp.net

I was in a problem while I was trying to use a checkbox that will select all checkboxes or deselect all the boxes in the check list. This codes gives the important service that while selected, if any one of the check boxes is deselected, the ‘chkHeader’ (check box which selected all) will be deselected. this is an important need of course!

Here,
chkHeader = is the ID of the checkbox which will select all.
chkSelect = is the ID of the checkboxes which are chekboxes of the list.

<script src="http://code.jquery.com/jquery-1.8.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('[id$= chkSelect]').click(function () {
if ($('[id$= chkSelect]').length == $('input[name="chkSelect"]:checked').length) {
('[id$= chkHeader]').attr("checked", "checked");
}
else {
$('[id$= chkHeader]').removeAttr("checked");
}
});
$('[id$= chkHeader]').click(function () {
var slvals = []
if ($(this).is(':checked')) {
$('[id$= chkSelect]').attr("checked", true);
}
else {
$('[id$= chkSelect]').attr("checked", false);
slvals = null;
}
});
})
</script>

Here is the code section that might help you to understand ASP.NET portion code of the selecting all check boxes.

<asp:GridView ID="CheckBoxDemo" runat="server">  
   <Columns>
         <asp:TemplateField>
         <HeaderTemplate>
            <asp:CheckBox ID="chkHeader" runat="server" />
         </HeaderTemplate>
        
          <ItemTemplate>               
                        <asp:CheckBox ID="chkSelect" runat="server" />
            </ItemTemplate>
                  
         </asp:TemplateField>
        
       
        <asp:BoundField DataField="checkbox1" HeaderText="checkbox1" Visible="true"  />
        <asp:BoundField DataField="checkbox2" HeaderText="checkbox2" Visible="true"  />
        <asp:BoundField DataField="checkbox3" HeaderText="checkbox3" Visible="true"  />      
        <asp:BoundField DataField="checkbox4" HeaderText="checkbox4" Visible="true"  />
      
  
   </Columns>       
   </asp:GridView>

# I thank Shuresh for his blog as it helped me to fix my problems.

HTML demo for this javascript segment:

<html><head></head>
<body>
<ul>
<li><label><input type="checkbox" name="chkHeader" value="All"/>
Select All
</label></li>
<li><label><input type="checkbox" name="chkSelect" value="3930"/>Mahmud</label></li>
<li><label><input type="checkbox" name="chkSelect" value="4049"/>Ahmed</label></li>
<li><label><input type="checkbox" name="chkSelect" value="4076"/>Faisal</label></li>
<li><label><input type="checkbox" name="chkSelect" value="4086"/>Srijon</label></li>
<li><label><input type="checkbox" name="chkSelect" value="4087"/>Shovon</label></li>
<li><label><input type="checkbox" name="chkSelect" value="4116"/>Nafee</label></li>

</ul>
</body>
</html>

localhost error :: connection Failed The system returned: (111) Connection refused

I installed my apache server in my PC, but yet, I couldnt load "localhost" . the error was. I was using Mozilla Firefox and IE both.

While trying to retrieve the URL: http://localhost/

The following error was encountered:

  • Connection Failed

The system returned:

 (111) Connection refused

Finally the solution I found was interesting!

  1. Go to the LAN settings (in Chrome : Tools-> Options-> Under the hood -> Change Proxy setting -> LAN Setting)
  2. There will be a checkbox for "Bypass proxy server for local address"
  3. Tick the checkbox.

Thanks to : this link