Click here to Skip to main content
16,020,701 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
pls can anybody help

i write this code n code behind converted from vb.net to C#.net

i got error in aspx page given below code but got Error "The name iff does not exist in current context"

XML
<asp:TemplateColumn HeaderText="Image" HeaderStyle-CssClass="dgHeaderItem">
                                        <HeaderStyle HorizontalAlign="Left" Width="25%"></HeaderStyle>
                                        <ItemStyle HorizontalAlign="Left" Width="25%"></ItemStyle>
                                        <ItemTemplate>
                                            <a id="aimg" runat="server" href="#"><asp:image Runat="server" ID="imgthumb" ImageAlign="middle" ImageUrl='<%# "../" + System.Configuration.ConfigurationManager.AppSettings["GALLERY_THUMBIMAGE_ROOTURL"] + DataBinder.Eval(Container.DataItem, "id") + DataBinder.Eval(Container.DataItem, "gallery_img")%>' /></a>
                                            <asp:Label ID="lblimg" runat="server" Visible="false" Text='<%# iif(isdbnull(DataBinder.Eval(Container.DataItem, "gallery_img"))," ", DataBinder.Eval(Container.DataItem, "gallery_img"))%>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateColumn>
                                    <asp:TemplateColumn HeaderText="Image Title" HeaderStyle-CssClass="dgHeaderItem">
                                        <HeaderStyle HorizontalAlign="Left" Width="40%"></HeaderStyle>
                                        <ItemStyle HorizontalAlign="Left" Width="40%"></ItemStyle>
                                        <ItemTemplate><%#DataBinder.Eval(Container.DataItem, "galler_name")%></ItemTemplate>
                                    </asp:TemplateColumn>


Thanks in advance
Posted

C# does not have a IIF method.

Google would have told you that.

Check out these search results for your answer:

Google it[^]
 
Share this answer
 
You are saying its converted to C#:

narendrarathod wrote:
<asp:label id="lblimg" runat="server" visible="false" text="<%# <b>iif</b>(isdbnull(DataBinder.Eval</blockquote><br mode=" hold=" />There is no iif in C#. <br mode=" xmlns:asp="#unknown">


There is no IIF in C#...
Simple lookup at the code would had told you!
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900