.Net Tips

How to Place your reusable code into Toolbox in Visual Studio?

This is very important and small tips for all VS users. Sometimes we need a small piece of code in many places of our application or in some different application. What we do? We just copy the code from one page and paste it to the destination page.

Visual Studio having a great feature, that you can place your code snippet inside the toolbox. For that you need to just select the code snippet and drag the selected snippet on to the general Tab.CodeSnippet

You can rename the selected snippet, by just right clicking on snippet and click on Rename.

RenameCodeSnippet

Now, you can use it anywhere in your application or in any VS Application by just drag and drop of the selected snippet.

Hope this will help you in future from rewrite of code.

How to Freeze GridView Header While Scrolling ?
This is very common problem in Web development that we need to freeze the GridView header at the time of scrolling, Here is one simple tips:
Step 1 : Create a CSS class as following

.HeaderFreez
{
position:relative ;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
}

Step 2 Set Gridview’s HeaderStyle CssClass as follows
CssClass="HeaderFreez"
That’s all. Some times we need also maintain the scroll positions while selecting any data from GridView, and quite difficult to maintain the position while we are using AJAX, I have written a complete article on that, hope this will help Maintain GridView Scroll Position inside updatepanel

Cheers!!
Abhijit

66 Responses to “.Net Tips”

  1. Rakesh Yadav Says:

    Hi Abhijit,
    Great article you are writing. Please help developmenet community much by writing various articles.

    Keep it up.
    Cheers!
    Rakesh Yadav

  2. Aftab Says:

    Thanks man!

    This is really a good tip. This is indeed helpful.

    Cheers!

    Aftab
    ComputerVideos.110mb.com/

  3. Amal Says:

    When i make a postback by textchange , the header of the grid move to the right of the page , and the layout of the datagrid changed to be wrong

    Do you have any solution

  4. Charan Says:

    Hi Dude!

    Iam a first time visitor of ur site.. its very nice.. and simple.. u just simply decorate your website with ur certifications which is very interesting !

    cheers

  5. Kranthi Says:

    Hai Abhi.
    compliments of the day.
    First of all we not from soft/hard fileds.my comapny having website last one year.i want to known how many pople viewed(visted) my company website.
    we want to keep comapny website in google search.

    Kindly advice

    Regards
    Kranthi

  6. Pankaj Says:

    Keep it up man.

  7. preety Says:

    Plz tell me the way to store images(jpeg) into the sql server 2000 and how to retrieve them.

    You have made a nice website of yours.

  8. simil Says:

    how to retrieve image from database

  9. Chandana Bharati Says:

    thanks for your wonderful tips. I am the regular reader of your articles. I have read your article ” Beginner’s Guide to ASP.NET Application Folder”. please send one article only on App_code like Session.

    • Abhijit Jana Says:

      Nice to know you liked my article. Regarding App_code article, there is noting much to write like session. I am really out of time… still Two article is in progress. hope to publishef soon.

  10. Pradeep Says:

    Great presntation .. never seen before on net .. Keep the great work going on..

  11. Abhishe Says:

    Good one.. jeet..

  12. MAHESH Says:

    Hi Boss,
    It’s really Suprep.NO words to explain you.Thank u very much.

  13. Sujoy Sarkar Says:

    Hi Abhijit,
    I am a regular reader of your articles.Just now I have read “Exploring Session in ASP.NET”,I liked it very much……keep publishing…

  14. Mohamed yasir.P Says:

    Hai Abijith, Your articles are great. Is there any way to play flash file in Gridview column

  15. Yugandhar Reddy Says:

    Hi Abhijit,

    i am really pleased with ur articles.this is the first time i am visiting ur site.i want to write microsoft certification exams.but i dont know which one to write as a fresher.could u tell me the exam name and number.
    thanks

  16. Sundervel Says:

    Hi Abhijit,
    Great work , have gone throug u r article so nice…..

  17. Kapil Lokhande Says:

    Hi Abhijit

    I am visiting your site first time. It’s really good to read such articles. Keep it up. Please mail me names of book you reffered before and reffering now related to ASP.NET,AJAX,C#,VB,SQL SERVER

  18. Shiva Says:

    Will above css (To freeze header of Grid) work in IE6?

  19. deepak Says:

    Hi dude,
    I read your article about ViewState.
    It is fantastic. It is first time I am visiting your article & it seems to me that I will explore all your your articles on the site. Please response my Q’s If I ask to u.
    Thanking u.

  20. Ashish Amodia Says:

    Hello Boss,
    How are you? I have seen you article on codeproject on session it is really nice.

    I impressed and go through your profile looks gr8 yaar :) keep it up. My self ashish amodia, done MCA working as software developer at surat. Nice to see you.

    This is my mail Id amodia.a.s@gmail.com.
    I am also on orkut “Ashish Amoida”.

    It think its good to be friends we can share many things.

    Ok than c u bbye
    whts ur ID ???

  21. Ashish Amodia Says:

    DADA :)

    Its really nice to know you. Gr8 keep it up :)
    nice knowing you.

    happy fortune …

  22. deepak Says:

    Hi Abhi,
    It’s pleasure to talk with u.
    I have a problem just like…
    I want to zoom+ a picture in ASP.NET on OnMouseover event. How it will get effect? I asked this question but one suggested to use “Jquery”. I m not familiar with “Jquery” but ASP.NET AJAX.

  23. deepak Says:

    Thanx dude,
    I m done with ur reply…Ohh..Sorry,I explored ur answers & You never replies,instead,it is always solution for the query…for me & same to all..
    Thank u again.

  24. Auto world Says:

    I really liked your blog and bookmarked it

  25. Zuc Says:

    Hi
    I’d like to receive more info on this:

    http://www.codeproject.com/Messages/3199136/Re-Passing-Credentials-from-ASP-NET-to-OWA.aspx

    please contact me by e-mail.
    thank you very much

  26. Anand Says:

    Hi i am begnier i asp.net and now days i am faceing some problem that is “Unabele to connect asp.net server” at the time of website run plz help me
    more evere ur realy cooooool

  27. krazyk Says:

    hello sir..

    i am developing 3-tier web application in asp.net with c#..

    right now in doubt regarding where to write code for session ,cookie management?

    will you give me example showing this clearly?

    thank you.

  28. Afroz Says:

    hi abhijit jana
    i am completed my BCA from mcu bhopal.i am developing web application in asp.net with c#..
    place give me tips.

  29. Avinash Kandimalla Says:

    hi abhijit jana

    I have completed by B.tech in cs stream. I am trying to develope a website in asp.net using c# i would like to know how i can add the session for each user and how to destroy it when user signout and the page must not be restored if he press the back button in the browser after signingout.I would be very thankful if i can get some sort of help from you so that i can learn something.
    Thanking you

  30. Ashish Shukla Says:

    Hi Abhijit Sir,
    This is ashish shukla from lucknow.Sir i have completed my mca from uptu and working in a lucknow based company.Sir i have visited ur site since last few months,i really inspired by you and your articles.Sir please guide me how can i explore my knowledge in field of .net.
    I will be very thankfull to u.

    • Abhijit Jana Says:

      Hi Ashish,
      Nice to know you liked my article and blog . Great man !!

      I have sent a mail to your gmail id from my personal id. Let me know if you need any help from me.

      Thanks again!

  31. Ashish Shukla Says:

    Thanks a lot for replying me sir !!

  32. Anurag Gandhi Says:

    Hi Abhijit,
    I am really impressed by your contribution towards .Net.
    Thanks a lot.

  33. Deepak Says:

    Hi Abhijit,

    Is it possible to write a code on selected index change event in javascript that will populate another ddl depending on selected value, hence to avoid server trip.

    Thanx..

  34. UDDHAV GARKAL Says:

    Hi Abhijit,

    I have seen your article and your your Website. I am realy impressed you.
    I read your article about ViewState. It is fantastic.

    keep it up !!!!!!!!!!!!!

    Regards & Thanks

    UDDHAV GARKAL
    (FACULTY)
    {NIIT}

Leave a Reply