Tuesday, October 26, 2010
Problem: The problem is when product is associated with two categories it is always fetching from primary parent category .
when product associated with two categories A and category B .It always fetch from category A even though we request for category B product .
If you don't have much knowledge on Commerce server API then get from knowledge from here.....
Runtime Commerce Server APIs (those that are used to retrieve info for use in a e-commerce website)
* ProductCatalog: Getting products from a catalog along with its child products
* CatalogContext.GetCatalogs: Getting a set of catalogs from the current context
* CatalogContext.GetCategory: Getting the details of a category including child categories
* CatalogContext.GetProduct: Getting the details of a product and product family including the variants
* CatalogSearch: Searching the catalog with the basic properties specified
Here is the code for Fetching product based on product id and Category
Friday, October 15, 2010
Getting the Browser's height and width is quite useful in many scenarios .Recently i have got a requirement in one of the project that is setting the background image based on the browser width and height . But the problem is there are so many different types of browsers out there and you don't know which one the end user will be using. Another issue is the height and the width of different laptops and desktops available in the market which are having different resolutions .
So most probably you are fine tuning your application based on the server or the PC or the laptop that you are using to develop. It will look perfectly fine until one day you decide to demo to your colleagues using a different laptop. All the layouts and alignments will be wrong. This happens if you hard code the height and width of the objects that you require in your site.
In my project requirement I need to set the back ground right side image based on browser width and height.So i have done this .please modify code according to your requirement.
Wednesday, October 6, 2010
every developer face .
Why browser caching ?
To speed up user experience on the web, most browsers implement a technology called caching. Caching allows information such as WebPages, images, and so on, to be saved on a user’s computer. If the user calls for a previously requested webpage, the browser is able to access the information more quickly by recalling it from a cache, rather than making another request to the site itself.
One side it is a advantage but when you display sensitive information it will be a big drawback .Recently we have found one problem in our current project .that is when user log in and after some operations sing out .if user click on back button it is still displaying logged in user .Hmmm..... We have tried different ways to handle the issue .But we have faced issues with Firefox .
So i have decided to write logic in master page load event .And i have added some login in logout page .Here is the code.
Place this code in master page in load event
In Logout page Load add this code
write this code in logout mark up page
call this RedirectToHome method in body onload of logout page
Run the application.Have a fun …