Posts

Showing posts from 2009
My new blog present here.

Featured Post

Insights into Sitecore Search: A Definitive Introduction

A key component of digital experience management is effective information retrieval. A simplified approach is required for websites, applications, and platforms containing a lot of material so that consumers can easily get the data they require. This need is met by Sitecore, a well-known name in the field of digital experience platforms (DXPs), which provides powerful and comprehensive search functionality. We will travel into the realm of Sitecore Search in this article, learning about its capabilities, architecture , and the enormous value it offers both developers and end users. Introduction to Sitecore Search    A headless content discovery platform powered by AI , Sitecore Search enables you to build predictive and custom search experiences across various content sources. To extract and ...

What is Delegate in .net(Delegate,Named method,Anonymous method)

A delegate is a type that references a method. Once a delegate is assigned a method, it behaves exactly like that method. The delegate method can be used like any other method, with parameters and a return value. In simple words, delegates are similar to pointer to a function in C++ but delegate are type safe . Delegates can be defined as methods that are used to call other method . The things which we need to consider is that the signature of the calling methods and delegates should match. Example: In C#: Declaration of Delegate: public delegate string AmitKumar(string Amit, string Kumar); Declaration of function: public string mcapassion(string AmitKumar, string AmitKumar_MCA04); Any method that matches the delegate's signature, which consists of the return type and parameters, can be assigned to the delegate. This makes is possible to programmatically change method calls, and also plug new code into existing classes. As long as you know the delegate's signature, you can as...

What is WPF and XAML

WPF : Windows Presentation Foundation (WPF) is the code-name of the presentation (user-interfaces) sub system in Windows Vista programming model and is used to create user interfaces. In broad way WPF is the engine that is responsible for creating, displaying, and manipulating user-interfaces, documents, images, movies, and media in Windows Vista. Physically, WPF is a set of libraries that have all functionalty you need to build, run, execute, and manage Windows Vista applications. XAML: XAML is a new descriptive programming language developed by Microsoft to write user interfaces for next generation managed applications. Relation between XAML and WPF: XAML is a new descriptive programming language developed by Microsoft to write user interfaces for next generation managed applications. XAML is used in WPF to represent the controls and code with the help of C#, Visual Basic, and other .NET Framework languages. XAML can be think as ASP.NET and/or Windows Forms in Windows Vista. For exam...

What is feature in SharePoint

Image
A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances, such as at the farm, site collection, web, etc. Features have their own receiver architecture, which allow you to trap events such as when a feature is installing, uninstalling, activated, or deactivated. The element types that can be defined by a feature include menu commands, link commands, page templates, page instances, list definitions, list instances, event handlers, and workflows. The two files that are used to define a feature are the feature.xml and manifest file(elements.xml). The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality. The "Feature" is one of the major concepts in WSS3.0. The Feature is a container of various defined extensions for SharePoint. A Feature can include any number of files, but it mus...

What is the difference between SPListItem.SystemUpdate and SPListItem.Update Method (Microsoft.SharePoint)

What is the difference between SPListItem.SystemUpdate and SPListItem.Update Method (Microsoft.SharePoint): SPListItem.SystemUpdate: Updates the database(Sharepoint list) with changes that are made to the list item, without effecting changes in the Modified Time or Modified By fields. SPListItem.SystemUpdate Overloaded Method: SPListItem.SystemUpdate(): Updates the database with changes made to the list item, without effecting changes in the Modified or Modified By fields. SPListItem.SystemUpdate(Boolean): Updates the database with changes that are made to the list item, without effecting changes in the Modified Time or Modified By fields, or optionally, the item version. Example: //Take the reference of that item SPListItem listItem = listItemCOll[icount]; listItem["FIRST_NAME"] = “Amit”; listItem["LAST_NAME"] = “Kumar”; listItem["EMAIL_ADDR"] = “mcapassion@gmail.com”; //Update the Item listItem.SystemUpdate(false); The argument false informs the SP objec...

Different between .ToString() and Convert.ToString() in C-Sharp(C#): Convert.ToString() vs .ToString()

I will explain you what is the different between .ToString() and Convert.ToString() with the help of below mentioned code: int intAmit =0; Response.write(intAmit.ToString()); Response.write(Convert.ToString(intAmit)); We can convert the integer “ intAmit ” using “ intAmit.ToString() ” or “ Convert.ToString(intAmit) ” ,so what is the basic difference between them: Convert: function handles NULLS .ToString(): does not handles NULLS and it will throw a NULL reference exception error. So as good coding practice is to use “ convert ” and it is always safe. Example: For example you received the data from database in the DataTable. One of the column in datatable is " Amit " and " Amit " column value in some rows of datatable are NULL. So, when you will try to convert "Amit" column value to string if column value is NULL, with the help of dt.Row[0]["Amit"].ToString() it will throw a NULL reference exception error . According to me when you need to ...

Authentication in ASP.Net

Authentication in ASP.Net There are three types of Authentication Levels exist in the ASP.Net : Windows Authentication, Forms Authentication, Passport Authentication. You can change/add authendication in web config file, in that you have to mention the authendication mode is Windows Authenticatin/Passport Authentication/Form Authentication as follows: // web.config file <authentication mode = "[Windows/Forms/Passport/None]"> </authentication> Windows authentication: enables you to identify users without creating a custom page. Credentials are stored in the Web server’s local user database or an Active Directory domain. Once identified you can use the user’s credentials to gain access to resources that are protected by Windows authorization. It’s a default authentication mode. Forms authentication: enables you to identify users with a custom database such as an ASP.NET membership database. Alternatively you can implement your own custom ...

ASP .Net Page Life Cycle

ASP .Net Page Life Cycle 1. OnInit (Init) Initializes each child control of the current 2. LoadControlState: Loads the ControlState of the control. To use this method the control must call the Page.RegisterRequiresControlState method in the OnInit method of the control. 3. LoadViewState: Loads the ViewState of the control. 4. LoadPostData: Is defined on interface IPostBackDataHandler. Controls that implement this interface use this method to retrieve the incoming form data and update the control s properties accordingly. 5. Load (OnLoad): Allows actions that are common to every request to be placed here. Note that the control is stable at this time; it has been initialized and its state has been reconstructed. 6. RaisePostDataChangedEvent: Is defined on the interface IPostBackData-Handler. Controls that implement this interface use this event to raise change events in response to the Postback data changing between the current Postback and the previous Postback. For example if a TextBo...

Caching Overview (ASP.Net)

Caching Overview: Abstract: Caching is a feature of ASP.NET that can dramatically improve the performance of your application by storing the page output or application data across HTTP requests. This article cover: What is Caching ? Benefits of Caching Introducing the Problems that Caching Solves Types of Caching What is caching? Caching is a feature that stores data in memory, allowing incoming requests to be served from memory directly. In the context of a web application, caching is used to retain pages or data across HTTP request and reuse them without the expense of recreating them . Benefits of Caching The following are the benefits of using Caching: Faster page rendering Minimization of database hits Minimization of the consumption of server resources Types of Caching Page Output Caching Page Fragment Caching Data Caching Page Output Caching: Page level, or output caching, caches the HTML output of dynamic requests to ASP.NET Web pages. The way ASP.NET implements this is throug...

Custom paging in grid view control using c#

Image
In one of my application I required to implement custom paging in the ASP.Net 2.0 Gridview control in the following pattern: " Previous 10 Pages Previous Page 1 2 3 4 5 6 7 8 9 10 Next Page Next 10 Pages " In ASP.Net 2.0 GridView is most often used to display the data retrieved from the database in Tabular form with features of Gridview like data paging, sorting and auto formats. For above mentioned paging, I find a way to implement custom paging in ASP.Net 2.0 GridView control. So this article basically describes how we can implement custom paging style in ASP.Net GridView control. CSharp (C#) code: #-----region Class for creating grid view navigation links-------- class NumericWithNext : ITemplate { GridView localGrid; int intSlotNo = 0; #region CONTRUCTOR public NumericWithNext(GridView gv) { localGrid = gv; //intSlotNo = slotNo; intSlotNo = localGrid.PageIndex / 10; //co...

How to move vertical scroll bar using javascript in ASP.Net Web Form

Whenever ASP.NET Web Form page loaded, by defualt its focus set to first control (vertical scroll bar moved downward in this case) in the ASP.Net web form page. If you required to move your vertical scroll bar to the top of the page, then following client-side script help you in achieving this task: <script> function moveVerticalScroll() { document.body.scrollTop=0; } window.onload= moveVerticalScroll ; </script>

How to set focus on control using javascript

This article demonstrates how to set focus to an ASP.NET Web Form control by using client-side script. ASP.NET Web Form controls provide a similar look and feel of the traditional HTML controls while they provide a consistent and structured interface and more robust features. In addition, you can use client-side scripting to enhance the functionality that these controls provide. In my project, i required to set focus on particular control on the drop down change event. For this i used/added following javascript on the SelectedIndexChanged event of drop down list: Page.RegisterStartupScript("MoveVerticalScrollBar", "<script>document.all('" + chkEmployee.ClientID + "').focus();</script>"); With the help of above script, focus set to chkEmployee control after the SelectedIndexChanged event of drop down list.