YouTube API with Asp.net C#

aspnet youtube

aspnet youtubeYouTube is a major video hosting website. IF you want to have videos on your website and you don’t want to host them, you can always use YouTube as a CDN. 1st method is to upload the video on YouTube and embed the code on your website, 2nd method is to make your website directly upload the videos to YouTube and embed them. YouTube provides a .Net Api to do this from your website directly or from your application. Continue reading “YouTube API with Asp.net C#”

BBM BlackBerry Messenger for Android and iPhone is here

BBM blackberry messenger

BBM blackberry messengerToday RIM decided to release their BBM messenger on Android and iPhone after their fail release on September 22, and asked everything to register on bbm.com to get a notification, since i did, I received this morning an email with title BBM for Android and iPhone is here ! after downloading the app from google play.. I think RIM should have waited more to perfect this service before making a release.

Continue reading “BBM BlackBerry Messenger for Android and iPhone is here”

Increasing Performance of ASP.Net web application

While developing large application performance is the major factor. Performance plays crucial role in development of any application. There are many ways to increase the performance of the application.Some of them are discussed below.

  1.  Page Level and Server controls:
  2.  State Management Level:
  3.  Data Access Level: 
  4.   Web Application Level:
  • Page Level and Server controls:
    • Avoid unnecessary round trips to the server.
      • use Microsoft Ajax and partial-page rendering to accomplish tasks in browser code.
    • use IsPostBack Property of page object to avoid unnecessary processing.
      • Avoid executing code on each postback if it only has to run the first time the page is requested.
    • while developing custom server controls. design them to render client script for some of their functionality.
      • Creating Custom Client Script by Using the Microsoft Ajax Library.
    • Use Server.Transfer and cross-page posting to redirect between ASP.NET pages in the same application.(For accessing controls and their values from the source page).
    • Leave buffering on unless you have a specific reason to turn it off .
      • There is a significant performance cost for disabling buffering of ASP.NET Web pages.
  •  State Management:
    •   Use View state of control when it is required.
      • By default, view state is enabled for all server controls. Disable it , by setting  EnableViewState property to false, as in the following example:
        <asp:datagrid enableViewState=”false” datasource=”…” runat=”server”/>
    • Avoid using view state encryption unless you have to.
      • View state encryption prevents users from reading view-state values in the hidden view-state form field.
    • Select appropriate session-state provider for your application. 
      • Asp.Net provides various ways to store data in a session.Based on the requirement and conditions of the application select appropriate session storage. Example:in-process session state, out-of-process session and creating custom session also possible.
    • Disable session state when you are not using it.
      • To disable session state for a page, set the EnableSessionState attribute in the @ Page directive to false, as in the following example:
        <%@ Page EnableSessionState="false" %>
        To disable it at application level,Use this property in web.config.
         <sessionState mode="Off" />
  •  Data Access Level:
    • Use SQL Server and stored procedures for data access:
      • SQL Server is the recommended choice for data storage to create high-performance, scalable Web applications.
    • Use the SqlDataReader class for a fast forward-only data cursor:
      • The SqlDataReader class creates a forward-only, read-only data stream that is retrieved from a SQL Server database.
    • Cache data and page output whenever possible:
      • use caching if there is no dynamic content request for every page request.
    • Use SQL cache dependency appropriately.
      • Use Table-based polling feature provided by SQL Server. In table-based polling, if any data in a table changes, all cache items that are dependent on the table are invalidated
    • Use data source paging and sorting instead of UI:
      • Don`t pull all the data from the database. use paging concepts and retrieve the number of records that are necessary to display.
    • Balance the security benefit of event validation with its performance cost.
    • Use SqlDataSource control caching, sorting, and filtering .
      • Set the number of threads per worker process.
          • Recycle processes periodically.
              • Preload the application.
                • initial start up response time can be improved by preloading.
              • Precompile Web site projects.
                • Initially project is batch compiled upon first request and this batch compilation compiles all pages in a directory to improve memory and disk usage.So  Precompile the whole project before deploying it into the server.
              • Disable debug mode. 
                • Disable debug mode before you deploy a production application.
              • Tune the configuration files for the Web server computer and for specific applications. Web Application Level:
    • For applications that rely extensively on external resources, enable Web gardening on multiprocessor computers.

Happy programming, share if you find usefull.

Source

CSS Positioning: A Comprehensive Look

CSS3 Logo

CSS3 LogoIf you’ve come to grips with CSS-based layouts, then it’s likely that you’re using floats as the primary means to layout your pages. Maybe you’ve even started to experiment with some of CSS’s far-future layout techniques, in hopes that browser support for them improves.

One aspect of CSS layouts that will likely be around for some time yet is CSS positioning. That is, using CSS’s position property. In this post, I’ll cover CSS positioning in detail and I hope you’ll come away from this with some more options in your CSS layouts. Continue reading “CSS Positioning: A Comprehensive Look”