Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

Customize Shortlist - Changing Shortlist.ascx
Last Post 07/04/2012 9:29 AM by Peter Donker. 1 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Andy Hedberg
New Member
New Member
Posts:3


--
06/29/2012 1:51 AM
Hello,

I have DMX installed and configured and am currently experimenting with the Shortlist extension. My use case is a close match, but a little customization is required.

I would like the file (in this case a pdf) to open in the browser window instead of initiating a download. I think that the key lies in the datagrid column definition, but my tinkering has not been fruitful. I assume the answer lies in the following code...



...Any pointers?

Below is the code for shortlist.ascx...


<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Shortlist.ascx.vb" Inherits="Bring2mind.DNN.Modules.DMX.Shortlist.Shortlist" %>
<asp:datagrid runat="server" id="dgFiles" cssclass="FileGrid_Container" width="100%" autogeneratecolumns="False" showheader="False" datakeyfield="EntryId" cellpadding="0" cellspacing="0" borderwidth="0" gridlines="none" headerstyle-cssclass="FileGrid_Header" itemstyle-cssclass="FileGrid_Item" AllowPaging="True" OnPageIndexChanged="FileGridPageCommand" PagerStyle-Mode="NumericPages" PagerStyle-HorizontalAlign="Left" PagerStyle-cssclass="FileGrid_Pager"> <br /> <columns> <br /> <asp:TemplateColumn Itemstyle-width="16"> <br /> <itemtemplate> <br /> <%# IconHtml(DataBinder.Eval(Container, "DataItem.Icon16")) %> <br /> </ItemTemplate> <br /> </asp:TemplateColumn> <br /> <asp:TemplateColumn> <br /> <itemtemplate> <br /> <a href='<%# IIF(DataBinder.Eval(Container, "DataItem.EntryType").StartsWith("File"), ResolveUrl("~/DesktopModules/Bring2mind/DMX/Download.aspx") & "?EntryId=" & DataBinder.Eval(Container, "DataItem.EntryId") & "&PortalId=" & PortalId.ToString & "&DownloadMethod=attachment", DataBinder.Eval(Container, "DataItem.Entry")) %>' class="Title"> <br /> <%#DataBinder.Eval(Container, "DataItem.Title")%> <br /> </a><br /> <br /> <span class="Description" style='display: <%= ShowRemarks %>'><%# DataBinder.Eval(Container, "DataItem.Remarks") %></span> <br /> </ItemTemplate> <br /> </asp:TemplateColumn> <br /> <asp:TemplateColumn Itemstyle-width="70"> <br /> <itemtemplate> <br /> <%# CType(DataBinder.Eval(Container, "DataItem.LastModified"), Date).ToString("d") %> <br /> </ItemTemplate> <br /> </asp:TemplateColumn> <br /> <asp:TemplateColumn Itemstyle-width="70" Itemstyle-Cssclass="Date"> <br /> <itemtemplate> <br /> <%# IIF(DataBinder.Eval(Container, "DataItem.EntryType").StartsWith("File"), Bring2mind.DNN.Modules.DMX.Common.Globals.FormatSize(DataBinder.Eval(Container, "DataItem.FileSize")), "") %> <br /> </ItemTemplate> <br /> </asp:TemplateColumn> <br /> </Columns> <br /> </asp:DataGrid> <br />
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
07/04/2012 9:29 AM
The attachment parameter tells your browser to download rather than display inline. You should be able to see this passed on in the headers of the response to the browser (using Fiddler for instance). It is up to the browser to decide what it does. I'm not aware of anything else you can do server side to influence this.

Peter
You are not authorized to post a reply.