Skip to main content

Posts

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...

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...

Google Recaptcha implementation without plugin

Google Recaptcha Implementation STEP 1: Add Following Script on you page: < script type ="text/javascript" src ="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"> script > < script src ="http://code.jquery.com/jquery-latest.pack.js"> script > < script type ="text/javascript"> function showRecaptcha(element) { Recaptcha.create( "your_public_key" , element, { theme: "clean" , callback: Recaptcha.focus_response_field }); } function showResult() { //alert('start'); var challengeVal = Recaptcha.get_challenge(); //alert(challengeVal); var reponseVal = Recaptcha.get_response(); alert(reponseVal); var remoteIp = "172.18.224.92" ; //alert(remoteIp); var privateKey = ’Your_Private_Key’; var r...

AJAX Progrraming

Ajax , shorthand for Asynchronous JavaScript and XML , is a web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not have to be reloaded each time the user requests a change. This is meant to increase the web page's interactivity, speed, and usability. The Ajax technique uses a combination of: XHTML (or HTML) and CSS, for marking up and styling information. The DOM accessed with a client-side scripting language, especially JavaScript and JScript, to dynamically display and interact with the information presented. The XMLHttpRequest object is used to exchange data asynchronously with the web server. In some Ajax frameworks and in certain situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server, and in other implementations, dynamically added tags may be used. ...