how to get records and images and display on page which are saved by module bulider
HI.
i have one case where i created one module with siteinfinity 4.4 and save some records and stroe images .
i am able display the records using following code
But how i will display image . or how i get image url
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DisplayItems.ascx.cs" Inherits="SitefinityWebApp.DisplayItems" %><%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><!-- ScriptManager or RadScriptManager is required by RadGrid, but this tag probably already exists on the Master Template --><!-- <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> --><telerik:radgrid id="Grid" runat="server" autogeneratecolumns="False"> <mastertableview> <columns> <telerik:gridboundcolumn datafield="Title" headertext="Title"> </telerik:gridboundcolumn></columns> </mastertableview></telerik:radgrid>// ~/DisplayItems.ascx.csusing System;using System.Linq;using System.Collections.Generic;using Telerik.Sitefinity.Model;using Telerik.Sitefinity.DynamicModules;using Telerik.Sitefinity.Data.Linq.Dynamic;using Telerik.Sitefinity.DynamicModules.Model;using Telerik.Sitefinity.Utilities.TypeConverters;using Telerik.Sitefinity.GenericContent.Model;namespace SitefinityWebApp public partial class DisplayItems : System.Web.UI.UserControl protected void Page_Load(object sender, EventArgs e) DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager(); Type profileManagerType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.ProfileManager.ProfileManager"); // Fetch a collection of "live" and "visible" Person items. var myCollection
= dynamicModuleManager.GetDataItems(profileManagerType).Where(i =>
i.Status == ContentLifecycleStatus.Live && i.Visible == true); // Binds the collection of Person items to the RadGrid Grid.DataSource = myCollection; Grid.DataBind(); Hello,
Get the module item or items and then call GetValue() you will need to add
using Telerik.Sitefinity.Model;
var myFilteredCollection = dynamicModuleManager.GetDataItem(cupType, new Guid( ... guid here)).GetValue("image");//the image field is called "image" GetValue() gets the value of a field by its namehow to get images from image gallery & bind it with Grid View?