This topic is locked

ASPRunner.Net & Image Display

1/30/2007 10:38:32 AM
ASPRunner.NET General questions
H
homeshopper author

Hi, I am using the latest version of ASPRunner.Net.

The following displays the content of a table from an access database.

I have a Field called ProductImageURL, this displays the path to an image.

how can I display the actual image.
<asp:BoundField DataField="ProductImageURL" ReadOnly="True" HeaderText="" SortExpression="ProductImageURL">

</asp:BoundField>
also I found the following link: http://www.xlinesoft.com/asprunner/docs/

Do you have a link for ASP.NET documents.
Many Thanks in advance.

Sergey Kornilov admin 1/30/2007

Set View as type of this field to File-based image (Formatting tab).
ASPRunner.NET documentation is available at http://www.xlinesoft.com/asprunnernet/docs/

Also you can click Help button any time while running ASPRunner.NET.

H
homeshopper author 1/30/2007

Set View as type of this field to File-based image (Formatting tab).

ASPRunner.NET documentation is available at http://www.xlinesoft.com/asprunnernet/docs/

Also you can click Help button any time while running ASPRunner.NET.


Thanks for your help, nearly got it right.

I followed your advice as above detail.

I now have the following code:

<asp:TemplateField HeaderText="">

<ItemStyle HorizontalAlign="center" ></ItemStyle>

<ItemTemplate>

<img border="0" src = 'imager.aspx?table=[Products]&field=/<%#Eval("ProductImageURL")%>'>

</ItemTemplate>

</asp:TemplateField>

The code runs imager.aspx and in turn runs the code behind page imager.aspx.vb

My main page now displays a broken image link.

The path set in the ProductImageURL field is as follows:

'../Ian/House/Thumnails/IMG_0744_thumb.jpg'

There is a different path & image set for each database record.
I have also tried changing the the following Set Edit as type of this field to File-based image (Formatting tab).

In the edit.aspx page it gives me a browse option to an image for each record.

When I update the page I get the following error:

Object must implement IConvertible.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Object must implement IConvertible.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[InvalidCastException: Object must implement IConvertible.]

System.Convert.ChangeType(Object value, TypeCode typeCode, IFormatProvider provider) +2563042

System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +248

System.Web.UI.WebControls.SqlDataSourceView.AddParameters(DbCommand command, ParameterCollection reference, IDictionary parameters, IDictionary exclusionList, String oldValuesParameterFormatString) +547

System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +324

System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +78

System.Web.UI.WebControls.DetailsView.HandleUpdate(String commandArg, Boolean causesValidation) +1154

System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +450

System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source, EventArgs e) +88

System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35

System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source, EventArgs e) +109

System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35

System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +86

System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +153

System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePo

stBackEvent(String eventArgument) +7

System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11

System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +172

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4919

Eugene 1/31/2007
  1. Set View as type of this field to File-based image (Formatting tab).
  2. Click on Change and set correct URL prefix.

    You can get more information about File-based image here: http://www.xlinesoft.com/asprunnernet/docs...ing_options.htm