Tuesday, January 12, 2010

Q. ASP.NET code behind function into grid view template field?

Q. How to call asp.net code behind function into gridview template field?
Answer: we can call code behind function in the gridview as follows
In asp.net markup:

<asp:TemplateField HeaderText="IsEnable">
<ItemTemplate>
<center>
<asp:Image ID="imgUserState" runat="server" Width="10px" Height="10px" ImageUrl='<%#GetImage(Eval("IsEnable")) %>'></asp:Image>
</center>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="IsApprover">
<ItemTemplate>
<center>
<asp:Image ID="imgApproverState" runat="server" Width="10px" Height="10px" ImageUrl='<%#GetImage(Eval("IsApprover")) %>'></asp:Image>
</center>
</ItemTemplate>
</asp:TemplateField>



In c# code behind file
    protected string GetImage(object ob)
    {
        bool IsActive = Convert.ToBoolean(ob);
        if (IsActive) return @"~/images/yes.png";
        else return @"~/images/no.png";
    }

Output is:





Thursday, January 7, 2010

Web designing stuff

http://davidwebb.blogspot.com/

http://jqueryfordesigners.com/

http://www.noupe.com/tutorial

http://www.tutelibrary.com/2008/08/creating-mac-style-drop-down-menu-with.html

http://www.dreamcss.com/2009/04/15-jquery-menu-dropdown-ipod-drilldown.html

http://www.ajaxline.com/10-best-jquery-menu-plugins

http://www.sohtanaka.com/web-design/mega-drop-downs-w-css-jquery/

Tuesday, January 5, 2010

Aravind Kumar Pampana's New SMS Channel

Click the following link to subscribe my new SMS channel for latest technology updates and news.
http://labs.google.co.in/smschannels/subscribe/Aravind00Kumar

Linq Result Set to DataTable Conversion Using C#

Add reference ->  System.Data.Linq