10245 : GTP.NET.WEB How to get rid of the PostBack events

Question

GTP.NET.WEB How to get rid of the PostBack events on the Rows when click on the Row of Gantt, such as _doPostBack(‘Grantt_ASP1′,’Row:0’), _ doPostBack(‘Grantt_ASP1′,’Row:1’), ect., We only need the PostBack events for Add and subtract.

Answer

Implement the OnAreaAttributes event. This event enables you to override the resulting area definition.

Untouched the grid row area definition looks like this:

<map name=’IMMapRow2Gantt_asp2′><area href=”javascript:__doPostBack(‘Gantt_asp2′,’ROW:2′)”  shape=’rect’ coords=’0,0,340,19′></map>

But since you do not want the postback in this case you must change the href.

    private void Gantt_ASP1_OnAreaAttributes(PlexityHide.GTP.WEB.Gantt_ASP aGantt, PlexityHide.GTP.WEB.AreaAttributeEventArgs e)
    {
      if (e.AreaKind==PlexityHide.GTP.WEB.AreaKind.TimeItemRow)
      {       
         // The default value of e.Result is formed like this href=\”javascript:__doPostBack(‘Gantt_ASP1′,’ROW:0;1’)\”
       
        e.Result=””; // You can clear that out to remove the postback. You can set another href to do some client side script…
      }
    }

Leave a Reply