Skip to main content

Posts

Showing posts from May, 2012

Wrap the data in Gridview

Sometime the data in Gridview column is large and it makes the scrollbar to appear on the page. Due to which User Interface of page get effected. Here are two solutions for achieving the required wrapping. Why two solution are provided? The reason is that sometime solution 1 doesn't work for all browser. It vary with the way how you are pulling the data in Gridview. Solution 1: Putting <ItemStyle> tag and setting the width of column. Wrapping the data using <ItemStyle> tag Solution 2: Putting <div> tag and styling on bounded column ( Works on all browsers ) Wrapping the data using <div> tag and styling Output:  Here is the output how data displayed in Gridview is wrapped. Gridview wrapping Keep posting your queries to get optimum solution.

System.BadImageFormatException

Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. An attempt was made to load a program with an incorrect format. 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.BadImageFormatException: Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. An attempt was made to load a program with an incorrect format. 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. Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Data.SQLite' could not be loaded. System.BadImageFormatException: System.Data.SQLite

Sitecore Best Practices

Design Prospective: 1. Put components statically in html if it is being used multiple times and not much changes required. Use placeholders only to bind those components which are getting change frequently. 2. Always set presentation details on _standard values. 3. Do appropriate image resizing on server else it will slow down the performance when opening on browse. 4. Create template for providing data to presentation component. 5. Get the Data from DataSource from component Parameters to get variations. Code Prospective: 1. Test your html/css/javascript code in such a way that Page Editor is enable for edit by non technical staff. 2. Given meaningful names to placeholder so that right component could add under right placeholder. 3. Write code using C# coz this is language generally use by Sitecore Support team. Use GUID instead of path/name as content can be moved to some other location in content tree. 4. Create separate config file for your component instead of adding directly in w

Sitecore customization using pipelines

A pipeline consists of a number of processors arranged in sequence to process a common set of parameters. If I have a series of tasks, which need to be performed to accomplish a task, then a pipeline may be the way to go. Instead of passing to each processor an arguments object containing these parameters, the pipeline class itself exposes properties representing the parameters. Sitecore pipelines also allow an object to pass through each step. This object can be manipulated by any of the steps and passed through to the next step until the end is reached and the object can be used by whatever executed the pipeline in the first place. In configuration file, you will be able to see numbers of pipelines, which is default from sitecore. You can create your own custom code and add pipeline to execute that code. Example: Pipeline contains parameter ‘type’, which contains information about class and assembly as shown in snapshot. UI customization using pipelines Each step in pipeline is calle