locked
How I can access an image and bind to a repeater in Microsoft Dynamics 2011 code n Visual Studio RRS feed

  • General discussion

  • var staffProfiles = from staff in XrmContext.new_peopleprofileSet

    select new

    {

    Name = staff.new_PeoplesName,

    Iwi = staff.new_Iwi,

    Position = staff.new_PositionandResponsibilities,

    };

    staffProfilesRepeater.DataSource = staffProfiles;

    staffProfilesRepeater.DataBind();

    I want to access Image field here and want to bind with this repeater. But this generates an error.  Can Anyone help me.

    # Page Code

    raj

    Tuesday, July 30, 2013 3:22 AM

All replies

  • Where is the image field stored ? CRM 2011 doesn't have a datatype for storing images in a generic entity; the only place you can store them would be in a note entity, which won't be directly part of your new_peopleprofileSet

    It would help if you post the details of the error

    Wednesday, July 31, 2013 8:49 AM
  • There are two links on my website  on the same page

    Staff Profile

    Student Profile

    When we click on staff profile, It display the detail of all the staff members with their name, qualification. Name is hyperlinked. When I click on the detail of any staff member name, it display all the information of that staff member – image , name, qualification, interest, activities

    On first page, where  name and qualification of all the staff members is displayed, I want to display image also.

    C# code to access these properties

    var staffProfiles = from staff in XrmContext.new_peopleprofileSet

                                        where staff.new_name.Contains("Staff")

                                        select new

                                        {

                                            Name = staff.new_PeoplesName,

                                            Iwi = staff.new_Iwi,

                                            Position = staff.new_PositionandResponsibilities,

                                            URL = "~/aboutus/staff?profileID=" + staff.Id.ToString(),

                                        };

    aspx page to display details of all staff members

    <asp:Repeater ID="staffProfilesRepeater"  runat="server">

                    <HeaderTemplate>

                    </HeaderTemplate>

                    <ItemTemplate>

                        <div>

                                

                           <a class="searchResultItemTitle" href='<%# Eval("URL") %>'><%# Eval("Name") %></a>

                            <br />

                            <p><span class="font_bold">Iwi:&nbsp;</span><%# Eval("Iwi") %></p>

                            <p><span class="font_bold">Position and Responsibilities:&nbsp;</span><%# Eval("Position") %></p>

                            <br />

                            

                          

                        </div>

                    </ItemTemplate>

                    <FooterTemplate>

                    </FooterTemplate>

                </asp:Repeater>

    As we click on the name of a staff and image get displayed, I want to display image in listing also.

    Image is uploaded in web files in CRM


    raj

    Thursday, August 1, 2013 2:02 AM