Hello Gilles,
I have done it like in your installation post and I found what you are mentioning.Now it is ok.But still my problem is remaining. I want to grab my image file from the database.Not from a folder.I have mention this in 2 parts.
1) Anyway First I try to show a label in the product detail view like this.Added a string to the \desktopmodules\Store\App_LocalResources\ProductDetail.ascx.Host.resx file like this.
test.Text testing my self
Then added my code to the \desktopmodules\Store\ProductDetails.ascx.cs
private Control processToken(string tokenName)
{
.
.
;
.
case "IMAGEDB":
Label lbltest = new Label();
lbltest.Text = Localization.GetString("test.Text", this.LocalResourceFile);
lbltest.CssClass = "StoreCategoryName";
return lbltest;
Then I added this [IMAGEDB] token to the template.
Output is the IMAGEDB .Not my test string. Please show me what is the issue with this of mine.
2) As I told you I want to show my Image as a token.This is my working code in another normal ASP.NET C# application.Can you help me to add this in to the switch-case statement.
private void Page_Load(object sender, System.EventArgs e)
{
//get the image id from the url
string ImageId = Request.QueryString["img"];
//build our query statement
string sqlText = "SELECT img_data, img_contenttype FROM Image WHERE img_pk = " + ImageId;
SqlConnection connection = new SqlConnection(ConfigurationSettings.AppSettings["DSN"].ToString());
SqlCommand command = new SqlCommand(sqlText, connection);
//open the database and get a datareader
connection.Open();
SqlDataReader dr = command.ExecuteReader();
if (dr.Read()) //yup we found our image
{
Response.ContentType = dr["img_contenttype"].ToString();
Response.BinaryWrite((byte[])dr["img_data"]);
}
connection.Close();
}
Please give me the solution for this.Thank you very much for your support.Waiting for your reply.