June 2008 - Posts

Tweaking Asp.Net Performance 2

1.On iis6, enable the Compress Static files. Web Folder Porperties->Service->Compress Static FIles.

this will cut the download java script files and etc which your page download  by half size.

2.Set loadscript before ui to false on every scriptmanager , declare directly to use scriptmode=release which make the ajax use the most optimized script

  <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"
  LoadScriptsBeforeUI="false" ScriptMode="Release">

3.Load you control object by javascript.

4.Cache the static page

 

Share this post: | | | |
Posted by cipto with no comments
Filed under:

Tweaking Asp.Net Performance

why is my application on asp.net is so slow

you can try to follow:

changing some setting on your web.config

and machine.config .

you can set memory level higher if your computer are stand alone web server , 

http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx

Compressing JPEG

http://msmvps.com/blogs/omar/archive/2008/04/07/reduce-website-download-time-by-heavily-compressing-png-and-jpeg.aspx

Aha , Our tags for asp.net ajax script  is always download first then the our page, so it slow at first , how to vice versa this?

 http://msmvps.com/blogs/omar/archive/2008/04/06/fast-page-loading-by-postponing-asp-net-ajax-scripts-after-content.aspx

 

Also use caching on static page.

i use sqlcachedepedency also for not so updated form.

 

Share this post: | | | |
Posted by cipto with no comments
Filed under:

Filtering with Ultrawebgrid

One caution that must be made.

if you choose to enable filtering and on server side, everything will not work.

it only filter the current page. not the whole page.

so you only get result from page one, but not filtering through all of the data source

i've tried it and read knowledge base that 

you've got to check the enable ajax. and choose the filtering on client side.

 and add some javascript

function UltraWebGrid1_CellClickHandler(gridName, cellId, button){
       var rowObj = igtbl_getRowById(cellId);
        if( rowObj != null )
        {
        if( rowObj.getDataKey() == null )
        {
            igtbl_cancelPostBack(rowObj.gridId)
        }

 add the cell click of the grid , layout->CliensideEvent->Cell click

 it should work for now...

:)

Share this post: | | | |
Posted by cipto with 1 comment(s)
Filed under:

The Difference between Bind and EVAL

not so many that explain this though.

but in a nutshell , bind is a two way binding, which means you read from and write to datasource. for ex: if you want to read and write from textbox

on the other hand eval , is a one way read from for ex; if you want to get value for label

 

Read more on:

http://weblogs.asp.net/leftslipper/archive/2007/06/29/how-asp-net-databinding-deals-with-eval-and-bind-statements.aspx

Share this post: | | | |
Posted by cipto with no comments
Filed under:

For Each Extension

i don't know if this is a repost.

But did you know that we can do a little extension with the for each that we always do.

we always use for each for enumerate the linq results right?

 we can do some extensions with it:

public static class Extensions

{

   public static void ForEach<T>(this Ienumerable<T> set,Action<T> action)

  {

    foreach(var t in set)

    {

    action(t);

    } 

  } 

 

if you notice Action<T> is a delegate . the delegate for void or not return anything method. it also extend to accept one param,two param and so on(T1,T2,T3).

 and then on your application side.

public static void Main

 int[] b=Enumerable.range(0,10).ToArray();

 Action<int> someactiondelegate=calculate;

b.ForEach<int>(someactiondelegate); 

public void calculate(int angka)

{

Debug.writeline((angka*angka).ToString());

 

Wala.... 

Share this post: | | | |
Posted by cipto with no comments
Filed under:

Gotcha ASP.Net

 after reading scott gu's blog on gotcha

i found several interesting stuff,that fix or enhanced on using asp.net

one of them is that if .. you put too many Class on your App_Code it will slow down when you open the designer

cause every time you you open the designer of a form it will compile your class on app_Code so that you can see the result.

so if you have many classes on your app_code , Make a new Class library Project and move your classes there, and reference the compiled library from your website

and for note antivirus can affect too.

there are also some setting that will speed up your build process one of them is to uncheck the build web site as part of solution on website property pages.

 

and also so many use full link on scott guru.....

hmmm... the blogs always technical and  i can grap the explanation.which i can not find it here.
(:of course he made this product)

but i also see a very distance between MVP indonesia and other's

Other's Blog is very inspiring,and technical

while here is theoritically which discuss not so important things , well not all but to name just a few are tehcnical

go indonesian.,..

Be more technical,

SHare your Knowledge

the more you share it the more you get it from others

 

Cia o

 

Share this post: | | | |
Posted by cipto with 1 comment(s)