Friday, June 14, 2013

Steps to Host WCF on Window 8

Step 01 :

Goto C:\Windows\System32\inetsrv\config\applicationHost
 then change this section of the application host file (Deny to Allow)
 <section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />


Step 02 :

Goto control panel - Programe and features - Turn window feature on or off
and change checked the following things.

       


Step 03 :

Run this command
C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe –i

By performing these three steps you will be able to host the WCF on window 8 / IIS 8

ThankYou.




Tuesday, May 21, 2013

How to Create WCF Services with Multiple Endpoints and Bindings in visual studio 2012

step 1-------------------------------------------
Create new WCF Application
File-New-Project-WCF Service Application


Step2-----------------------------------------------------
Delete the created files Service1 and IService1 from the project

Step3- ----------------------------------------------------
right click on the project add-new item-WCF service and give it a proper name

after adding this service two file are created in the project one is  IMultipleBindingService.cs interface



[ServiceContract]
    public interface IMultipleBindingService
    {
        [OperationContract]
        void DoWork();
    }



another is MultipleBindingService.svc



public class MultipleBindingService : IMultipleBindingService
    {
        public void DoWork()
        {
        }
    }




Step4---------------------------------------------------------
just make some changes in the IMultipleBindingService.cs


[ServiceContract]
    public interface IMultipleBindingService
    {
        [OperationContract]
        string GetDate();
    }


 and in MultipleBindingService.svc


public class MultipleBindingService : IMultipleBindingService
    {
        public string GetDate()
        {
            return DateTime.Now.ToString();
        }
    }

Step5-----------------------------------------------------------------
Now we created the service that return us a current date time  Lets expose this service through multiple endpoints and bindings

in web.config we configure two endpoints one for Basichttp Binding and other for WSHttpBinding


<?xml version="1.0"?>
<configuration>

  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5"/>
  </system.web>
  <system.serviceModel>
    <services>
      <service name="MultipleWcfService.MultipleBindingService" behaviorConfiguration="Mg">
        <endpoint name="BasicHTTPBinding" address="/BasicHttpBinding" binding="basicHttpBinding" contract="MultipleWcfService.IMultipleBindingService" />
        <endpoint name="WSHTTPBinding" address="/wsHttpBinding" binding="wsHttpBinding" contract="MultipleWcfService.IMultipleBindingService" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:49714/MultipleBindingService.svc" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Mg">
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>  
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>

</configuration>


Step6------------------------------------------------------------------

Right Click on the solution and add-new Project- Select Console Application



after creating the Console application right click on the references and add service reference

give the service address and press ok.

Step7----------------------------------------------------------------------

access the service in the client by both endpoints by their name


 static void Main(string[] args)

        {
            MultipleBindingServiceClient proxy = null;
            //BasicHTTPBinding
            proxy = new MultipleBindingServiceClient("BasicHTTPBinding");
            Console.WriteLine(proxy.GetDate());

            //WSHTTPBinding
            proxy = new MultipleBindingServiceClient("WSHTTPBinding");
            Console.WriteLine(proxy.GetDate());
        }


hopefully this post is helpfull for you thanks












Thursday, March 14, 2013

DataRow.Delete Is Not Equal To DataRows.Remove() OR DataRows.RemoveAt()

DataRow.Delete() VS DataRows.Remove() or RemoveAt()

==============================================================
Important Namespaces: 
- System.Data.Sql
-System.Data.SqlClient
==============================================================
Facing an issue inside one of my projects, i was trying to iterate through the datatable datarows and while i was iterating i was removing datarows using a loop index which was going from 0 upto row count of datatable. But i was constantly facing an error. 

"collection was modified. Enumeration operation might not execute."

There i got the difference. I was using DataRows.Remove() or DataRows.Removeat(). Both function remove the datarow physically and committedly from the datatable which was being used in that loop meanwhile. Now important thing is that you cannot mantain the same count of the rows if you are inside the loop and you are using DataTable.rows.count for iteration condition. 

BUT 

Instead you should use the DataRow.Delete() function. Delete() function will not physically delete the row from datatable. It will mark the row to be deleted or update the rowstate as RowState.deleted. The change will not be committed until you call Datatable.acceptchanges() function. 

Now whatever you do with your datatable it will not commit your changes until you call Acceptchanges() function. 



Thursday, February 21, 2013

Windows shortcut commands

Hello everyone, Today I will share windows shortcut commands on a single place, this will hopefully help everyone in our daily activities

appwiz.cpl    It will open control panel

msconfig    open system configuration

ncpa.cpl     open network settings

eventvwr     open event viewer

inetmgr        open IIS

iisreset           reset IIS

services.msc for opening services console

profiler90    opening sql profile

installutil -i path  for installing (eds) service with visual studio command prompt

regedit    for opening registry editor

dxdiag    opening system diagnostic

msinfo32   open System information

taskmgr opening task manager

mspaint for opening paint

mstsc   Remote Desktop

mmc    open micrososft management console

devmgmt.msc  open device manager  

perfmon   open perfomance monitor

gpedit.msc  Grop policy

compmgmt.msc  open computer management  

%windir%\system32\MdSched.exe   windows memory diagnostics 

%windir%\system32\odbcad32.exe    data sources (ODBC)

printmanagement.msc             open printer management

wmimgmt.msc  open Windows Management Infrastructure (WMI)  

lusrmgr.msc open Local Users and Groups  

certmgr.msc  open certificates  manager

Deleting Services from service Console

Create a new process to the call the "sc.exe" with the parameters as below:

sc.exe delete [service name] 


Thank You....

Friday, February 15, 2013

Deploying File Along With Feature

Few days back, I was working to create an Editor Web Part. The Editor Part contains a drop down and I need to populate it with an XML file (Links.xml) . I had given the file name in XmlDatasource, considering it would be picked, but Editor part gave me an error i.e. file not found.

After doing some research, I came to know a new deployment type ElementFile. This deployment type physically deploy the file along with the feature and we can get the path of the feature then.




SharePoint provides a method for this purpose i.e.. SPUtility.GetGenericSetupPath. By using this method I found my XML file and me editor part started working. I hope this will help any other newbie  in SharePoint..... :)fF

14 HIVE AND OTHER SHAREPOINT 2010 DIRECTORIES


In this post I will list out some important folders used with SharePoint 2010 server. Lets Start with  installation, Configuration and its files, later in the post we will discuss about other 14 hive directories.

C:\Inetpub\wwwroot\wss -
 This directory (or the corresponding directory under the Inetpub root on the server) is used as the default location for IIS Web sites.
C:\ProgramFiles\Microsoft Office Servers\14.0 - This directory is the installation location for SharePoint Server 2010 binaries and data. The directory can be changed during installation.
C:\ProgramFiles\Microsoft Office Servers\14.0\WebServices - This directory is the root directory where SharePoint back-end Web services are hosted, for example, Excel and Search.
C:\ProgramFiles\Microsoft Office Servers\14.0\Data - This directory is the root location where local data is stored, including search indexes.
C:\ProgramFiles\Microsoft Office Servers\14.0\Logs – This directory is the location where the run-time diagnostic logging is generated.

14 hive folders : 


Program Files\Common files\Microsoft Shared\Web Server Extensions\14 -

This directory is the installation directory for core SharePoint Server files.

Program Files\Common files\Microsoft Shared\Web Server Extensions\14\ADMISAPI -

This directory contains the soap services for Central Administration. If this directory is altered, remote site creation and other methods exposed in the service will not function correctly.


Program Files\Common files\Microsoft Shared\Web Server Extensions\14\CONFIG -
This directory contains files used to extend IIS Web sites with SharePoint Server. If this directory or its contents are altered, Web application provisioning will not function correctly.

Program Files\Common files\Microsoft Shared\Web Server Extensions\14\LOGS -

This directory contains setup and run-time tracing logs.
Program Files\Common files\Microsoft Shared\Web Server Extensions\Policy -
Program Files\Common files\Microsoft Shared\Web Server Extensions\UserCode -
This directory contains files used to support your sandboxed solutions.
Program Files\Common files\Microsoft Shared\Web Server Extensions\WebClients -
This directory contains files related to the new Client Object Model.
Program Files\Common files\Microsoft Shared\Web Server Extensions\WebServices -
This directory contains new wcf or .svc related files.
I hope this post will be helpful for you in understanding SharePoint 14  Hive folder hierarchy. Thank You,.

Friday, February 8, 2013

Error occurred in deployment step ‘retract solution’ cannot start service SPUserCodeV4 on this computer


Yesterday I was creating my first SharePoint 2010 Sand-boxed solution using Visual Studio 2010.  I have successfully built and deployed other SharePoint projects on the server but I always used Farm based solution due to the requirements.
When I built the Sand-boxed solution the project would build and package without any errors but when I tried to deploy it to the SharePoint site the following error occurred:
Error occurred in deployment step ‘Activate Features’: Cannot start service SPUserCodeV4 on computer ‘SERVERNAME'
The error can be easily resolved by starting the Microsoft SharePoint Foundation Sandboxed Code Service which can be accessed through the Central Administration site in SharePoint.   Open the Central Administration site and go to System Settings and click on Manage Service on server, as shown below



After starting the service try to deploy the snadoxed solution and the following erros wil be removed. 
"Error occurred in deployment step ‘retract solution’ cannot start service SPUserCodeV4 on this computer"


Thursday, February 7, 2013

This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application


Here is another SharePoint post for the deployment guys. I was deploying a SharePoint solution using SharePoint Admin utility i.e. Stsadm . I started facing error i.e. "This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application"

After analyzing the error message i.e. why I cannot deploy the solution to a web application. However if you do not like to deploy the solution to all the web applications and only like to deploy your solution to a specific application , you need to change the solution settings Assembly Deployment Target from GlobalAssemblyCache to WebApplication.



Change Assembly Deployment Target to Web-application, as shown below





After you change the Assembly Deployment Target and run the script again, you will have the solution deployed successfully. Happy deployment.


Sunday, February 3, 2013

SharePoint Hives Folders

SharePoint has hives folder for all the SharePoint major versions i.e 2007 has 12 hive, 2010 has 14 hive and now SharePoint 2013 has 15 hive folder. Let me elaborate the naming convention that why SharePoint has different hives folder name, then the SharePoint release name.

Basically Hive folder naming convention is development version of SharePoint. As SharePoint team is keep on working on different features of SharePoint all the team, so keep on creating different versions but Hive represent the production version which Microsoft release for SharePoint  I hope this post will help you in understanding why we have different Hive folder naming convention, then SharePoint.

Thank You.

Friday, February 1, 2013

Comments Rendering Issue in Sharepoint

I was working on a custom SharePoint master page, few days ago. After deploying the master page in Gallery, I set it for my site-collection. I had started facing a strange error i..e master tag is already defined. Initially I thought, that SharePoint existing pages, inherited from some other master page and I might override  it, but it also didn't work.

After some time, I started looking my master page html, I had a commented master tag, which I believe should not be rendered by SharePoint, as commented. I removed the commented tag for testing purpose, and surprisingly things starts working. SharePoint engine actually render the commented tag as well.

I hope this post will help any newbie in SharePoint world..... Happy Coding.....:)

Thursday, January 24, 2013

Generating Public key token


Many times we need to get the Public key token for a strongly named assembly in .NET.  “how to get the public key token?”. Answer is very simple use the .NET Framework tools sn.exe. So open the Visual Studio 2008 Command Prompt and then point to the dll’s folder you want to get the public key,

I have used the following command, for generating public key token for a SharePoint project
sn.exe –T SPExcercise1.dll
Public key token is d95388ccbe5ad4c1
This will give you the public key token. 
Remember one thing this only works if the assembly has to be strongly signed.

Monday, January 21, 2013

soap:ServerServer was unable to process request. ---> Value does not fall within the expected range.


In some odd situation, SharePoint Designer (SPD) 2010 would throw this error:
“soap:Server was unable to process request. Value does not fall within the expected range”
Cause
SPD does not open the site with name it was originally defined.  For example, the site was created as http://xyzmachine:9999/, but SPD connects it as http://localhost:9999/
Solution
SPD should connect the site with name/url defined at its creation.

Wednesday, October 17, 2012

Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentException


Few days ago, I was working on a Windows Azure App, I created a Web Role  which was representing my application interface. Its purpose was to upload images. I needed to generate thumbnails as well.I thought to delegate this responsibility to a Worker Role. 
My Web Role  add image to a Blob and add a message in queue as well for the worker role, so that it can read it and generate thumbnails for each queued image, later.
When I created a worker role and tried to access the storage account with my defined connection string, it started giving me RoleEnvironmentException , I set the connecting-string for the application so I thought it will work for both Web ad Worker Roles, but it was not the case.
For Windows Azure, we have to set connection string for every worker and web roles, independently. I hope this will help any new bee on Windows Azure. 
Thank You and Happy Coding.......

Tuesday, October 16, 2012

Datatable belongs to another dataset


DataTable already belongs to another DataSet this error we get when we are trying to add table into datatset which is already belonging to another dataset. So whats the solution?Its simpleUse Copy() method of DataTable to add to your dataset e.g.

objDataSet.Tables.Add( dataTableFromDataSetA.Copy() ); 

//here objDataSetis your Dataset and dataTableFromDataSetA is DataTable.


Hope this post save your time. Thank You.

Tuesday, October 2, 2012

Jquery Tabs


Let me mention few simple steps to implement tab in Jquery :


First, make sure the HTML (ASPX) page you are creating is pointing at the stylesheet that contains the jQuery UI theme you are using.  The tabs make use of the themes and will not render as tabs unless the styles are pulled in.


Next you’ll need to create the HTML.  Everything that has to do with tabs should be wrapped in a DIV.  You can either give the ID a class or give it an ID, as long as you can select it later to apply the tabs() method that turns it all into a tabbed interface. Suppose our parent div is  


Within that DIV, you’ll place an unordered list:

<ul> <li><a href="#cricketTab">Cricket</a>

</li> <li><a href="#hockeyTab">Hockey</a></li> <li>

<a href="#footballTab"> Foot Ball </a></li> <li>

<a href="#basketballTab"> Basket Ball </a></li> </ul>

which represents your tabs.  Notice the href=”#id” stuff.  Those are pointing to ids of the DIVS that come next.

<div id="cricketTab">Cricket content</div> <
<div id="hockeyTab">Hockey content</div> <
<div id="footballTab"> Foot Ball content</div> <
<div id="basketballTab">Basket Ball content</div>

Next, in your jQuery code, select the outer DIV and call tabs()


$(function() {
$("#tabs").tabs();
});



By following this simple steps , tabs will be created.  For full documentation go to Jquery Tab. Thank You.

Tuesday, September 25, 2012

SET NOCOUNT Usage


SET NOCOUNT ON, in SQLSERVER, is used to stop the message that shows the count of the number of rows affected by the SQL statement written in the stored procedure or directly SQL Statement. You can view this message in the Management Studio in the Message tab of the result pan. 

When NOCOUNT is ON - the number of affected rows will not be returned 
 When NOCOUNT is OFF - the number of affected rows will be returned   

Triggers also need it, as its useful, If we don't turned on NOCOUNT, their performance can be drastically affected . Take, for example, INSERT triggers that are fired repeatedly, especially when using INSERT INTO statements for massive insert operations. In such cases where the trigger is fired over and over again during the course of the statement, the trigger will issue DONE_IN_PROC messages for each INSERT action, which can slow things down drastically. 

This slow down is especially pronounced if the trigger is being fired as the result of a scheduled SQL Server Agent job. SQL Server Agent automatically imposes a delay after each DONE_IN_PROC signal to avoid server congestion. If you try running the same set of commands through the Query Analyzer, it will execute much faster since no such delays are imposed. If you run such a query through Query Analyzer and see multiple "n rows affected" statements, there's a good chance the query is iterating repeatedly and re-firing the trigger many more times than it really needs to. To turn off DONE_IN_PROC messages, use the SET NOCOUNT ON command at the start of a trigger statement. 

 Microsoft actually encourages the use of SET NOCOUNT ON in Stored Procedures. 
 There is another thing @@ROWCOUNT, which is relevant to this. It is used to get the number of rows affected. Note that either the SET NONCOUNT is ON or OFF, @@ROWCOUNT is always updated with the number of rows affected.

 I hope this post help everyone in understanding the usage of SET NOCOUNT. Thank You.


Monday, September 24, 2012

Multiple Active Result Sets


SQL Server 2005 has so many new features , One of those is Multiple Active Result Sets or MARS. Multiple Active Result Sets is a new SQL Server 2005 feature that, putting it simply, allows the user to run more than one SQL batch on an open connection at the same time.

Pre-SQL 2005 era

In SQL Server's prior to 2005, you could only run one batch per connection. This means simply that you could only do this:
private void MARS_Off()
{
    SqlConnection conn = new SqlConnection("Server=serverName;
        Database=adventureworks;Trusted_Connection=yes;");

    string sql1 = "SELECT * FROM [Person].[Address]";
    string sql2 = "SELECT * FROM [Production].[TransactionHistory]";

    SqlCommand cmd1 = new SqlCommand(sql1, conn);
    SqlCommand cmd2 = new SqlCommand(sql2, conn);
    cmd1.CommandTimeout = 500;
    cmd2.CommandTimeout = 500;
    conn.Open();
    SqlDataReader dr1 = cmd1.ExecuteReader();
    // do stuff with dr1 data
    conn.Close();

    conn.Open();
    SqlDataReader dr2 = cmd2.ExecuteReader();
    // do stuff with dr2 data
    conn.Close();
}
And the accompanying profiler trace:
This example shows that you could use the same connection with the second SqlDataReader only when you finished using the connection with first one. The connection must be closed and reopened as it is shown with Audit Login and Audit Logout events. Opening and closing a connection is an expensive operation so this can hurt performance, even if your connection is stored in the connection pool.
If you for instance wanted to do some processing of the data in your data reader and updating the processed data back to the database you had to use another connection object which again hurts performance. There was no way to use the same opened connection easily for more than one batch at the time. There are of course server side cursors but they have drawbacks like performance and ability to operate only on a single select statement at the time.

SQL 2005 era

SQL Server 2005 team recognized the above mentioned drawback and introduced MARS. So now it is possible to use a single opened connection for more than one batch. A simple way of demonstrating MARS in action is with this code:
private void MARS_On()
{
    SqlConnection conn = new SqlConnection("Server= serverName;Database=adventureworks;
        Trusted_Connection=yes;MultipleActiveResultSets=true;");
    
    string sql1 = "SELECT * FROM [Person].[Address]";
    string sql2 = "SELECT * FROM [Production].[TransactionHistory]";

    SqlCommand cmd1 = new SqlCommand(sql1, conn);
    SqlCommand cmd2 = new SqlCommand(sql2, conn);
    cmd1.CommandTimeout = 500;
    cmd2.CommandTimeout = 500;
    conn.Open();
    SqlDataReader dr1 = cmd1.ExecuteReader();
    SqlDataReader dr2 = cmd2.ExecuteReader();
    conn.Close(); 
}
And the accompanying profiler trace:
MARS is disabled by default on the Connection object. You have to enable it with the addition of MultipleActiveResultSets=true in your connection string.

Wednesday, May 16, 2012

Refresh Rad Grid After Save Button Clicked 

Here is a sample code when save button is clicked then it refreshes the RAD Grid.

I am gonna put RAD Grid in panel.


<asp:Panel runat="server" ID="UsersPanel">
        <telerik:RadGrid AutoGenerateColumns="False" ID="RadGrid_Users" PageSize="10" AllowCustomPaging="true"
            EnableViewState="true" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
            runat="server" Skin="Vista"
            OnNeedDataSource="RadGrid_Users_OnNeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <GroupingSettings CaseSensitive="false" />

 <MasterTableView TableLayout="Fixed" DataKeyNames="User_id">

<NoRecordsTemplate>
                    <div>
                        No records to display.</div>
                </NoRecordsTemplate>
 <Columns>

<telerik:GridNumericColumn Aggregate="Count" HeaderText="User_id" DataField="User_id"
                        UniqueName="Customer_id" SortExpression="User_id" HeaderStyle-Width="50px" FilterControlWidth="50px"
                        AutoPostBackOnFilter="true" CurrentFilterFunction="equalto" ShowFilterIcon="true" FilterListOptions="VaryByDataType"
                        Display="false">
                    </telerik:GridNumericColumn>

 <telerik:GridBoundColumn HeaderText="Navn" DataField="Name" UniqueName="Name"
                        SortExpression="Name" HeaderStyle-Width="120px" FilterControlWidth="100px" FilterListOptions="VaryByDataType"
                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="true">
                    </telerik:GridBoundColumn>

 </Columns>
            </MasterTableView>
            <ClientSettings EnablePostBackOnRowClick="true">
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
        </telerik:RadGrid>      
        </asp:Panel>


  <telerik:RadButton ID="Button_Save" runat="server"  Text="Gem" Width="125px" OnClick="Button_Save_Click"
                        Skin="Office2007" />


In RadAjaxManager  define which control you want to update.Here give Control ID of panel.








<telerik:RadAjaxManager ID="RadAjaxManager1"  EnableAJAX="true"  runat="server" >
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="UsersPanel">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="UsersPanel"  LoadingPanelID="RadAjaxLoadingPanel1"/>
                   
                    </UpdatedControls>
                </telerik:AjaxSetting>


<telerik:AjaxSetting AjaxControlID="Button_Save" >
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="UsersPanel" LoadingPanelID="RadAjaxLoadingPanel1"/>                    
                    </UpdatedControls>
                </telerik:AjaxSetting>


 </AjaxSettings>
 <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />

</telerik:RadAjaxManager>      
     
        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1"
            Skin="Windows7" Transparency="20" />



<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function RequestStart(sender, eventArgs) {
                    var eventTarget = eventArgs.get_eventTarget();
                    if (eventTarget.indexOf("Button_Save_Click") != -1) {
                        eventArgs.set_enableAjax(false);
                    }

                }
                function ResponseEnd(sender, eventArgs) {
                }
            </script>
        </telerik:RadCodeBlock>


Have Fun ;)





Tuesday, April 24, 2012

Differnce between new and override

It is asked very frequently, that how can we call the parent version of a method in inheritance. In C# we can use new keyword to define a new method in child class and get this effect. I have mentioned a little example that will illustrate you the difference between override and new keyword :


//Calls Base class function 1 as new keyword is used.

BaseClass bd = new DeriveClass();

bd. function ();



//Calls Derived class function 2 as override keyword is used.

BaseClass bd2 = new DeriveClass();

bd2. function ();




Thank You. Happy coding....

Tuesday, April 17, 2012

Drag Events on IOS Devices using JQuery

These issues arise many times when you create a site e.g. on Asp.net with JQuery and some of the events doesn't work at all... Events like Drag drop, double click gestures.... 

We will talk about drag drop events in this case. Assuming that Drag drop events are working perfecting fine on the normal system browsers, here is the way to make it work for smart devices and tablets.

1. Add "touch-punch.min.js" file on your project.
2. Add the following line on your aspx page or control:

<script src="jquery.ui.touch-punch.min.js"></script>
 
3.  Now just add this line on the script portion

<script>
$('#widget').draggable();
</script>
 
 
That's it. You just need to add few lines and your website will now support drag drop gestures
on an iPhone/iPad/iPodTouch. 
 
 Happy coding!!!
 
Click on this link to download the script. 

Earn Money ! Affiliate Program
Open Directory Project at dmoz.org