an ASP.NET Open Source CMS & eCommerce platform
Search:
Last Post 1/19/2011 11:36:21 AM By Bahram. 7 replies.
1/13/2011 4:44:01 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Product.productName
 Hi Luke,
 
I need to use this object to make url. How can I get the value to make a string for onclick or onclientclik in JScript and not C#
 
Thanks,
1/17/2011 9:54:56 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product.productName
In your code behind just emit the html with product.ProductName in the onclick attribute.
DotShoppingCart Staff
1/17/2011 2:24:59 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Product.productName
I am using onclick="window.open('HTTP://MyStore/ProductNAME  ')" 
 
How I can use product.Productname in this string 
1/17/2011 2:50:54 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Product.productName
 I use this control in Store\productDescriptor
1/17/2011 3:47:55 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product.productName
If product is the protected or public property of your control code behind file, you can use <%= product.ProductName %> in the ascx or aspx file. 
DotShoppingCart Staff
1/17/2011 4:12:38 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Product.productName
 Hi Luke,
 
I used DefaultTemplate.aspx since Product object was visible so i could use Product.ProductName and even Product.CutomField as well.
 
The better solution is to create a separate aspx page and include it in Defaulttemplate. For this I need to see Product Class in that page. What directive I must use at the top.
 
I see at DefaultTemplate directives and no explicit reference to Product Class, but it is visible to ASP cource.
 
Thanks,
1/19/2011 9:35:29 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Product.productName
If you look at DefaultTemplate.aspx.cs you will see something like the following line. This is how Product gets passed down to the user control. Again this is too basic ASP.NET stuff. I suggest you go through a basic ASP.NET training course.
 
productPrices.Product = Product;
DotShoppingCart Staff
1/19/2011 11:36:21 AM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Product.productName
I did not look at c# file and codes, just ASPX page and HTML control.
I do not want to touch code for simple tweaks.