A Place for C Sharpers/.Netters

I Will do coding till last moment of life-Kiran Patil

Archive for May, 2009

<tbody>using Table control

Posted by kiranpatils on May 30, 2009

Challenge:

How I generate <tbody> tag using Table, TableRow, etc … controls ?

I want to generate table o/p like this:

<table border="1">
  <thead>
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$80</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <td>Sum</td>
      <td>$180</td>
    </tr>
  </tfoot>
</table>

Src : http://www.w3schools.com/TAGS/tag_tbody.asp

I want to create table like this from my code

behind using .net f/w classes.

Solution:

TableRow.TableSection is the solution for it:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.tablerow.tablesection.aspx

for whatever row you create just provide it’s TableSetion property to appropriate section e.g Body,head etc.

Hope this helps

Happy Programming!!

Posted in ASP.NET, ASP.NET Controls | Leave a Comment »

.NET Framework Common Namespaces and Types Poster

Posted by kiranpatils on May 30, 2009

Background:

This post is dedicated to guys who do believe in OOPS or eager to learn OOPS Concepts[Like me :) ].  Our .NET F/w is built heavily on OOPS concepts. So, if you see take any Class like System.Web.UI.WebControls.TextBox if you see it’s CD and dig more in it you will learn a lot:

image 

This is just one example if you take any Control/Class of .NET F/W you will understand more how it has been designed and why?

So it is always good to have all namespace and types poster with you always too look at it while you are having cup of coffee :)

 Framework Version

Download Link

3.5 http://www.microsoft.com/downloadS/details.aspx?familyid=7B645F3A-6D22-4548-A0D8-C2A27E1917F8&displaylang=en
2.0 http://blogs.msdn.com/photos/brada/images/524537/original.aspx

 

So, Grab this and take a print out of it and have fun :)

Programming With Fun!!

Posted in .NET, Uncategorized | Tagged: , | Leave a Comment »

Visual Studio Keyboard shortcut Posters

Posted by kiranpatils on May 30, 2009

Background:

We all developers daily[On weekends also] use Visual Studio. And most of the time we do some common tasks like Comment Code[CTRL+K+C] and Uncomment Code[CTRL+K+U]. Some of us do Manually

//Single line comment

/* Multiline comment */

Or some of us use VS Toolbar for doing the same.

This is just one piece of stuff i told there are so many types of  stuff which we do regularly. So why not use Shortcuts for that? Good idea..But from where can i find all the shortcuts for Visual Studio? Here it is:

Microsoft guys have published posters[in pdf format] for us:

 Visual Studio Version-Language

Download Link

VS 2008-C# http://www.microsoft.com/downloadS/details.aspx?FamilyID=e5f902a8-5bb5-4cc6-907e-472809749973&displaylang=en
VS 2008-VB http://www.microsoft.com/downloadS/info.aspx?na=47&p=4&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=e5f902a8-5bb5-4cc6-907e-472809749973&u=details.aspx%3ffamilyid%3d255B8CF1-F6BD-4B55-BB42-DD1A69315833%26displaylang%3den
VS 2005-C# http://www.microsoft.com/downloadS/info.aspx?na=47&p=3&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=e5f902a8-5bb5-4cc6-907e-472809749973&u=details.aspx%3ffamilyid%3dC15D210D-A926-46A8-A586-31F8A2E576FE%26displaylang%3den
VS 2005-VB http://www.microsoft.com/downloadS/info.aspx?na=47&p=2&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=c15d210d-a926-46a8-a586-31f8a2e576fe&u=details.aspx%3ffamilyid%3d6BB41456-9378-4746-B502-B4C5F7182203%26displaylang%3den

 

Hope this helps to increase your productivity :)

Programming With Fun!!

Posted in Posters, VS 2005, VS 2008 | Tagged: , , | Leave a Comment »

Insert Cell alternative for Firefox

Posted by kiranpatils on May 20, 2009

Hi folks Sorry for being invisible since so long. But i really got tied up with my bits. :)

Anyway today i have something to share with you all so here it is:

Challenge:

I have one JavaScript in which i am creating one table cell and adding it to table. It works fine in IE[As always :) ] But not in FF[As always :) ].

var newTable = document.createElement(‘table’);
var newRow = newTable.insertRow( ); 
 var newCell1 = newRow.insertCell( );

Solution:

So, finally my friend Google helped me to find a way:

just pass –1 to insertCell Method and have a good sleep!

var newTable = document.createElement(‘table’);
var newRow = newTable.insertRow( ); 
var newCell1 = newRow.insertCell( -1);

Reason:

I don’t know. If you do please do let me know :)

Happy Programming!

 

Posted in Javascript | Tagged: , | 5 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 167 other followers