Friday, 22 January 2016

RECOVER HIDDEN FILES AND FOLDERS OF PEN DRIVE USING CMD PROMPT


Generally we will facing a big problem as hiding and not showing our files when we use our pen drives and memory cards in some other systems coz of virus problem
To remove such virus follow the steps
  1. Open administrative command prompt.
  2. Go to your pen-drive drive letter. Suppose your USB disk is G:. Type G: and press Enter
  3. Now type the below command to remove system file, hidden read-only attribute
    attrib -s -h -r /s /d *.*
  4. Delete Autorun.inf from USB – Disk.
  5. This makes all files visible and you are now able to delete them .
  6. del *.lnk
  7. Now to remove the shortcuts from pen-drive , Check the size of any One or Few Shortcuts, all be same.
  8. Delete suspicious files, on errror check task manager for process with same name or any suspicious process and end it.
  9. Open Explorer and right Click on Pen-drive , Click Open.
  10. Search with Advance Search for all files of same size in Pen-drive.
  11. Select All and Delete

Tuesday, 12 May 2015

jQuery interview Question - Part II

Previous I already posted basic Interviews question in jQuery Basic Interview Question
 Here some more for you

21. What is the difference between size and length of jQuery?
Size and length both returns the number of element in an object. But length is faster than the size because length is a property and size is a method.
22. Can we add more than one ‘document.ready’ function in a page?
Yes, we can add more than one document.ready function in a page. But, body.onload can be added once in a page.
23. What is the use of jQuery load method?
jQuery load method is a powerful AJAX method which is used to load the data from a server and assign the data into the element without loading the page.
24. Whether our own specific characters are used in place of $ in jQuery?
Yes, We can use our own variable in place of $ by suing the method called no Conflict ( ) method.
var sample = $.noConflict( )
25. What are the four parameters used for jQuery Ajax method?
The four parameters are

  •          URL – Need to specify the URL to send the request
  •          type – Specifies type of request(Get or Post)
  •          data – Specifies data to be sent to server
  •          Cache – Whether the browser should cache the requested page
26. What is the use of jQuery filter?
The jQuery filter is used to filter the certain values from the object list based on the criteria. Example is to filter certain products from the master list of products in a cart website.
27. Which program is useful for testing jQuery?
QUnit is used to test jQuery and it is very easy and efficient.
28. What is CDN?
CDN is abbreviated as Content Distribution network and it is said to be a group of companies in different location with network containing copies of data files to maximize bandwidth in accessing the data.
29. What are the two types of CDNs?
There are two types of CDNs:

  •          Microsoft – Load jQuery from Ajax CDN
  •          Google – Load jQuery from Google libraries API
30. Which sign is used as a shortcut for jQuery?
Dollar ($) sign is used as a shortcut for jQuery.
31. Is jQuery is a client or server scripting?
jQuery is a client scripting.
32. What is the script build up by jQuery?
jQuery is a Javascript file and it is single javascript file that contains common DOM, event effects and Ajax functions.
33. How can we debug jQuery?
There are two ways to debug jQuery:
Debugger keyword

  •          Add the debugger to the line from where we have to start debugging and then run Visual Studio in Debug mode with F5 function key.
  •          Insert a break point after attaching the process
34. What are all the ways to include jQuery in a page?
Following are the ways to include jQuery in a page:

  •          Local copy inside script tag
  •          Remote copy of jQuery.com
  •          Remote copy of Ajax API
  •          Local copy of script manager control
  •          Embedded script using client script object
35. What is the use of jQuery.ajax method ()?
jQuery.ajax method is used for asynchronous HTTP requests.
36. Where can we download JQuery?
jQuery javascript can be downloaded from jQuery official website – www.jquery.com
37. Is jQuery is a replacement of JavaScript?
No, jQuery is not a replacement of JavaScript.
38. What is called chaining?
Chaining is used to connect multiple events and functions in a selector.
39. What are the advantages of jQuery?
Following are the advantages of jQuery:

  •         Just a JavaScript enhancement
  •         Coding is simple, clear, reusable
  •         Removal of writing more complex conditions and loops
40. Whether C# code behind can be called from jQuery?
Yes, we can call C# code behind from jQuery.
41. What is the use of jQuery.data() method?
jQuery data method is used to associate data with DOM nodes and JavaScript objects. This method will make a code very concise and neat.
42. What is the difference between onload() and document.ready()?
In a page, we can have only one onload function but we can have more than one document.ready function. Document.ready function is called when DOM is loaded but onload function is called when DOM and images are loaded on the page.
43. What is the use of jQuery each function?
jQuery each function is used to loop through each and every element of the target jQuery object. It is also useful for multi element DOM, looping arrays and object properties.
44. How method can be called inside code behind using jQuery?
$.ajax can be called and by declaring WebMethod inside code behind using jQuery.
45. Which is the fastest selector in jQuery?
ID and Element are the fastest selectors in jQuery.
46. What is the slowest selector in jQuery?
Class selectors are the slowest selectors in jQuery.
47. Where jQuery code is getting executed?
jQuery code is getting executed on a client browser.
48. What is the method used to define the specific character in place of $ sign?
‘NoConflict’ method is used to reference a jQuery and save it in a variable. That variable can be used instead of Sign.
49. Why jQuery is better than JavaScript?
jQuery is a library used for developing Ajax application and it helps to write the code clean and concise. It also handles events, animation and Ajax support applications.
50. What are the types of selectors in jQuery?
There are three types of selectors in jQuery:

  •          CSS Selector
  •          XPath Selector
  •          Custom Selector

Saturday, 28 March 2015

jQuery Important Interview Questions


1. What is jQuery?
jQuery is not a programming language but a well written JavaScript code. It is a JavaScript code, which do document traversing, event handling, Ajax interactions and Animations.

2. Why jQuery is needed?
jQuery is needed for the following list:

  • Used to develop browser compatible web applications
  • Improve the performance of an application
  • Very fast and extensible
  • UI related functions are written in minimal lines of codes

3. Whether jQuery HTML work for both HTML and XML documents?
No, jQuery HTML only works for HTML documents not for XML Documents.

4. What are the methods used to provide effects?
Some of the effects methods are:

  • Show( )
  • Hide( )
  • Toggle( )
  • FadeIn( ) and
  • FadeOut( )

5. What is the advantage of using minimized version of jQuery?
Efficiency of web page increases when minimized version of jQuery is used.min.js file will be more than 50% less than the normal js file. Reduction in the file size makes the web page faster.

6. Is jQuery is a JavaScript or JSON library file?
jQuery is a library of JavaScript file and it consists of DOM, event effects and the Ajax functions. jQuery is said to be a single JavaScript file.

7. Which operating system is more compatible with jQuery?
Mac, Windows and Linux are more compatible with the jQuery.

8. How can we include jQuery library in ASP.Net project?
Download the jQuery library from jQuery.com and include that reference in the asp.net page.

9. Which command will give a version of jQuery?
The command $.ui.version returns jQuery UI version.

10. In what scenarios jQuery can be used?
jQuery can be used in following scenarios:

  • Apply CSS static or dynamic
  • Calling functions on events
  • Manipulation purpose
  • Mainly for Animation effects

11. What is the difference between find and children methods?
Find method is used to find all levels down the DOM tree but children find single level down the DOM tree.

12. What is jQuery connect?
A ‘ jQuery connect’  is a plugin used to connect or bind a function with another  function. Connect is used to execute function from any other function or plugin is executed.

13. How to use connect?
Connect can be used by downloading jQuery connect file from jQuery.com and then include that file in the HTML file. Use $.connect function to connect a function to another function.

14. What are the features of jQuery, has been used in web applications?
jQuery uses features like Sliding, File uploading and accordian in web applications.

15. What are the browser related issues for jQuery?
Browser compatibility of jQuery plugin is an issue and needs lot of time to fix it.

16. Whether we need to add jQuery file in both Master and Content page?
jQuery file should be added to the Master page and can use access from the content page directly without having any reference to it.

17. What are the basic selectors in jQuery?
Following are the basic selectors in jQuery:

  • Element ID
  • CSS Name
  • Tag Name
  • DOM hierarchy

18. Can we call C# code behind using jQuery?
Yes, we can call C# code from jQuery as it supports .net application.

19. What is the use jQuery.data method?
jQuery.data methods is used to associate the data with the DOM nodes and the objects. This data method makes the jQuery code clear and concise.

20. What is the use of each function in jQuery?
Each function is used to iterate each and every element of an object. It is used to loop DOM elements, arrays and the object properties.

Click here for More Interview Question

Wednesday, 10 December 2014

All the best

My dear students, Friends and blog followers,

Thanx for ur support. I hope this blog can little bit help to your career.

    I will share new technology and new concepts in a quick time.

 This is a comma but not a fullstop.



Yours

Hanumantha Rao

Saturday, 15 November 2014

Routing in MVC

Routing within the ASP.NET MVC framework serves two main purposes:

  •  It matches incoming requests that would not otherwise match a fi le on the file system and maps the requests to a controller action.
  •  It constructs outgoing URLs that correspond to controller actions.

The preceding two items describe only what Routing does in the context of an ASP.NET MVC application. 

NOTE: 
 One constant area of confusion about Routing is its relationship to ASP .NET MVC. In its pre-beta days, Routing was an integrated feature of ASP.NET MVC. However, the team saw that it would have a useful future as a fundamental
feature of ASP.NET that even Web Pages could build on, so it was extracted
into its own assembly and made part of the core ASP.NET framework. The
proper name for the feature is ASP.NET Routing, but everyone simply shortens
it to Routing.
Putting this feature into ASP.NET meant that it became a part of the .NET
Framework (and, by association, Windows). So, while new versions of
ASP.NET MVC ship often, Routing is constrained by the schedule of the larger
.NET Framework; hence, it hasn’t changed much over the years.
ASP.NET Web API is hostable outside of ASP.NET, which means it can’t use
ASP.NET Routing directly. Instead, it introduces a clone of the Routing code.
But when ASP.NET Web API is hosted on ASP.NET, it mirrors all the Web API
routes into the core ASP.NET Routing’s set of routes. Routing, as it applies to
ASP.NET Web API

Comparing Routing to URL Rewriting
To better understand Routing, many developers compare it to URL rewriting. After all, both approaches are useful in creating a separation between the incoming URL and what ends up handling the request. Additionally, both techniques can be used to create pretty URLs for Search Engine Optimization (SEO) purposes.
The key difference is that URL rewriting is focused on mapping one URL to another URL. For example, URL rewriting is often used for mapping old sets of URLs to a new set of URLs. Contrast that to Routing, which is focused on mapping a URL to a resource.
You might say that Routing embodies a resource-centric view of URLs. In this case, the URL represents a resource (not necessarily a page) on the Web. With ASP.NET Routing, this resource is a piece of code that executes when the incoming request matches the route. The route determines how the
request is dispatched based on the characteristics of the URL — it doesn’t rewrite the URL.
Another key difference is that Routing also helps generate URLs using the same mapping rules that it uses to match incoming URLs. URL rewriting applies only to incoming requests and does not help in generating the original URL.
Another way to look at it is that ASP.NET Routing is more like bidirectional URL rewriting.
However, this comparison falls short because ASP.NET Routing never actually rewrites your URL.
The request URL that the user makes in the browser is the same URL your application sees throughout the entire request life cycle.

Saturday, 4 October 2014

Page development in Sharepoint


Bydefault Sharepoint server has two types of pages. 1.Page(Wiki) 2.Web Part Page

1.Page: This is a normal wiki page. In this page we can add text, images, links, ..
2.Web Part Page : This is also a page but here we can't create any text. Only for adding webparts to the page.

We have another type of page is called Publishing page. This is the combination of both page and webpart. If we want to create publishing page means first we should show this option in page list like below.

SiteActions --> SiteSettings --> SiteActions --> ManageSiteFeatures -->  SharePoint Server Publishing ----> Activate. Now you will find the option Publishing page.


==================================

Webpart Page
SiteActions --> MoreOptions --> Page ---> Web Part Page ---> Create --> 
i.Name : SPDemoPage .... Check/uncheck :Overwrite if file already exists? 

ii.Layout : Select a layout template to arrange Web Parts in zones on the page. Multiple Web Parts can be added to each zone. Specific zones allow Web Parts to be stacked in a horizontal or vertical direction, which is illustrated by differently colored Web Parts. If you do not add a Web Part to a zone, the zone collapses (unless it has a fixed width) and the other zones expand to fill unused space when you browse the Web Part Page.
   Choose any one layout template. 
Ex.Header, Footer , 3columns  / Full page, Vertical / Header leftcol, body 

iii.Save Location : Select the document library where you want the Web Part Page to be saved.  choose any one of the following
SiteAssets / Shared Documents / SitePages

A new webpart page will be opened. now you can add webparts by click on Add a web part. 
After adding webparts to the page then click on Stop Editing option. Now page is ready.
*While adding webparts you can also drag webparts from one place to another place.

Web part  zone is like div tag in asp.net / html.
We can add / delete or move webparts from one place to another place.

Publishing Page
This page is the combination of wiki page and web part page. We have 5 types of publishing pages available. Those are
1.Articles 
2.Wiki Page 
3. Project 
4. Redirect 
5. Welcome

SiteActions --> MoreOptions --> Page ---> Publishing Page --> Create --> 
1.Page Title and Description : Enter a URL name, title, and description for this page.   

2.Page Layout : Select a page layout to control how the page will be displayed. 
  i.(Article page) body only: The article page with body only contains a rich text field.
 ii.(Article page) Image on left : The article page with image on left contains an image field and a rich text field
iii.(Article page) Image on right :The article page with image on right contains an image field and a rich text field.
iv.(Article page) Summary Links : The article page with links contains an image field and summary links. 

v.(Enterprise Wiki Page) Basic page:A basic page layout containing a single content area.

vi.(Project Page) Basic Project Page:A basic page layout containing a single content area.

vii.(Redirect Page)Redirect : This page layout contains a redirect control for automatically directing readers to any specified URL.

viii.(Welcome Page) Blank Web part page: Page layout for creating web part pages
ix.(Welcome Page)Splash : The welcome with splash contains an image field on left, a rich text field and Web Part zones arranged in a header, and 2 columns.  The left navigation pane is hidden.
x.(Welcome Page) Summary Links :The welcome page with summary links contains an image field on left, a rich text field, 2 summary links, and Web Part zones arranged in a header, a footer, and 2 columns.
xi.(Welcome Page) Table of contents: The welcome page with table of contents contains an image field on left, a rich text field, a table of contents Web Part, and Web Part zones arranged in a header, a footer, and 2 columns.

Click on Create.
Now you can add text, images ..... after completion of creating Save the page then click on Publish --> Publish ---> Enter any comments if ... Continue click

While you are developing the publishing page its status is 'Checked out' Means it is under design. So no one cant access this page. 

Like you can create all publish pages of enterprisewiki, basic project page, redirect page and welcome page.

============================================================

Tuesday, 23 September 2014

Sharepoint Realtime Interview questions

Important interview questions for Sharepoint Developer
Q. How will you deploy files such as Css, js in SharePoint 2010?
Ans. The most preferable way to deploy files in SharePoint is by using the solution package. In SharePoint 2010 you can create an empty project with VS 2010 and then add a new SharePoint Mapped folder  in it. This will give the desired location in 14 hive where you can then add a file to deploy.

Q. Can you display a page as a modal dialog?
Ans. Yes, any page can be displayed as modal dialog. A Modal dialog takes options as a parameter and we can speciy the url for any page usually saved in _layouts.

Q. Can you display the modal dialog from a webpart?
Ans. Yes a modal dialog can be displayed from within a webpart code since its a JavaScript block that can be registered on the page.

Q. What is difference between an Application page and a Custom aspx page in SharePoint 2010. If you have to deploy a page with some code in it which one would you prefer?
Ans.
Application Page – You would typically use an applictaion page when you need some content that is merged with SharePoint master page. A master page enables application pages to share the same appearance and behavior as other pages on a site. Application page generally gets deployed in _layouts and inhertirs the look and feel of the site that you are using.
A Custom .net aspx page on the other hand would need content and master page tags in your page to make it inherit the look and feel of the site.
I would prefer deploying an application page with code as it is much easier and has built-in templates available in VS 2010.

Q. What is Docuement Set and how is it useful to the end users?
Ans. A Document Set is a group of related documents that can be created in one step and then managed as a single entity. This can be seen as a folder of documents with a cover letter(welcome page) and which can share common data between its documents (share document set info\columns).
Document Set is very useful when it comes to managing the documents for a single project or task. For e.g. a manager while working on a project wants to create a single folder\entity with all the documents related to that project. He also wants that each document shares the project info (for e.g. Project Id, Manager name etc.) and can be checked in\checked out individually. Document Set will also allow him to add a cover letter\welcome page to the entity(or his set of documents) and use some basic document features like record version history, start a workflow, e-mail document set etc.

Q. What are Projected Fields in SPQuery and when would you use that?
Ans. In SharePoint 2010, Referential integrity can now be implemented using Lookup columns. Joins and ProjectedFields properties of SPQuery were introduced to facilitate this. Projected Fields are the fields which you can access when a list is joined by a lookup columns. These are additional columns from a parent lookup column list.

Q. What is WebProvisioned event receiver and when would you use that?
Ans. WebProvisioned event receiver is fired after the site has been created and is fully provisioned(asynchronous). For e.g. if you want to update the site title of logo after its been created or if you want to add a new list\library after the out-of-box site has been created you can use the WebProvisioned event handler.

Q. If you have to add a new Ribbon button to one of the existing tabs how will you identify the location?
Ans. The Its typically Ribbon.Tabs.group.Controls._children.

Q. How does Client object model works ?
Ans. When we use SharePoint client API’s to perform a specific task, the SharePoint Foundation 2010 managed client object model bundles up these uses of the API into XML and sends it to the server that runs SharePoint Foundation. The server receives this request, and makes appropriate calls into the object model on the server, collects the responses, forms them into JavaScript Object Notation (JSON), and sends that JSON back to the SharePoint Foundation 2010 managed client object model. The client object model parses the JSON and presents the results to the application as .NET Framework objects (or ECMAScript objects for ECMAScript).

Q. How many types of Client Object model extension are available in 2010 and when would you use one or the other.
Ans. To develop rich client side solutions, three set of client-side APIs has been introduced in the Microsoft.SharePoint.Client namespace. The three APIs are targeted for three different types of clients.
1. .net Managed applications – These are used when we have to create console applications or window applications, web applications which are not running inside SharePoint Contex.
2. For Silverlight applications
3. ECMAScript – It is a client object model extension for using with JavaScript or JScript. This is used for creating applications which are hosted inside SharePoint. For example, web part deployed in SharePoint site can use this JavaScript API for accessing SharePoint from browser using JavaScript.

Q. What is difference between Load() and LoadQuery() methods ?
Ans. Load method populates the client object directly with what it gets data from the server i.e. a collection object like ListItemCollection etc. but LoadQuery returns the data as a completely new collection in  IEnumerable format. Other major difference is that the Collections that you load using the Load() method are eligible for garbage collection only when the client context variable itself goes out of scope where as, in  these collections go out of scope at the end of  IEnumerable<List>list.

Q. How can you write efficient and better performing client object applications ?
Ans. You can always use Lambda expressions in your queries to return only specific properties that will be used in your block. You can also use LoadQuery() method and specify multiple levels of properties to load for e.g. while returning specific properties of the lists using LoadQuery(), you can also specify the fields to return from each list to optimize the data access.

Q. How do you access ECMAScript object model API’s ?
Ans. The ECMAScript library is available in a number of JS files in the LAYOUTS folder. The main file among number of .js files is SP.js. When you include this file in the APSX page using a ScriptLink control, all other required JS files are loaded automatically. By linking SP.js to your page, the SP namespace gets registered. SP is the SharePoint namespace that contains all objects. For debugging purposes every js file also has a ‘debug’ equivalent in the same folder.

Q. What is the purpose of calling clientContext.ExecuteQuery() ?
Ans. ExecuteQuery gives you the option to minimize the number of roundtrips to the server from your client code. All the components loaded into the clientcontext are executed in one go.

Friday, 22 August 2014

SharePoint 2013

Welcome to the world of SharePoint 2013. SharePoint 2013 Production version is released & Live implementations are going on. In this article I would like to re-iterate the features of SharePoint as a whole & advantages of going with it.

Sharepoint Features
Depending on the business perspective the features of SharePoint are many:

How to Install SharePoint 2013?

As SharePoint is a server side software, it requires the Windows Server operating system. You can start with a new installation or use a Virtual Machine. Once you have the Operating System ready, you can download and install SharePoint 2013 from the following link: http://technet.microsoft.com/en-us/evalcenter/hh973397.aspx .

Hardware Requirements

Following are the core hardware requirements:
  1. CPU 64-bit
  2. RAM 8 GB
  3. HDD 80 GB

Software Requirements

Following are the software requirements:
  1. Windows Server 2012
  2. Microsoft SQL Server 2012 64-bit
  3. Internet Information Services 7.5
  4. Microsoft .NET 4.5

Friday, 18 July 2014

Routing MVC 4

Routing
·         All ASP.NET MVC traffic starts out like any other website traffic: with a request to a URL. This means that, despite the fact that it is not mentioned anywhere in the name, the ASP.NET Routing framework is at the core of every ASP.NET MVC request.
·         In simple terms, ASP.NET routing is just a pattern-matching system. At startup, the application registers one or more patterns with the framework’s route table to tell the routing system what to do with any requests that match those patterns.
·         When the routing engine receives a request at runtime, it matches that request’s URL against the URL patterns registered with it (Figure 1-6).
·         When the routing engine finds a matching pattern in its route table, it forwards the request to the appropriate handler for that request.
Otherwise, when the request’s URL does not match any of the registered route patterns, the routing engine indicates that it could not figure out how to handle the request by returning a 404 HTTP status code.
Configuring Routes
ASP.NET MVC routes are responsible for determining which controller method (otherwise known as a controller action) to execute for a given URL. They consist of the following properties:
Unique name : A name may be used as a specific reference to a given route
URL pattern : A simple pattern syntax that parses matching URLs into meaningful 
segments

   
                                                         Figure 1-6. ASP.NET routing
Defaults : An optional set of default values for the segments defined in the URL pattern Constraints
A set of constraints to apply against the URL pattern to more narrowly define the URLs that it matches
The default ASP.NET MVC project templates add a generic route that uses the following URL convention to break the URL for a given request into three named segments, wrapped with brackets ({}):
 “controller”, “action”, and “id”: {controller}/{action}/{id} This route pattern is registered via a call to the MapRoute() extension method that runs during application startup (located in App_Start/RouteConfig.cs):
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index",
id = UrlParameter.Optional } // Parameter defaults
);
In addition to providing a name and URL pattern, this route also defines a set of default parameters to be used in the event that the URL fits the route pattern, but doesn’t actually provide values for every segment.
For instance, Table 1-1 contains a list of URLs that match this route pattern, along with corresponding values that the routing framework will provide for each of them.

Table 1-1. Values provided for URLs that match our route pattern
URL                                        Controller                               Action                         ID
/auctions/auction/1234             AuctionsController                      Auction              1234
/auctions/recent                        AuctionsController                      Recent
/auctions                                  AuctionsController                      Index
/                                               HomeController                         Index

·         The first URL (/auctions/auction/1234) in the table is a perfect match because it satisfies every segment of the route pattern, but as you continue down the list and remove segments from the end of the URL, you begin to see defaults filling in for values that are not provided by the URL.
·         This is a very important example of how ASP.NET MVC leverages the concept of convention over configuration: when the application starts up, ASP.NET MVC discovers all of the application’s controllers by searching through the available assemblies for classes that implement the System.Web.Mvc.IController interface (or derive from a class that implements this interface, such as System.Web.Mvc.Controller) and whose class names end with the suffix Controller.
·         When the routing framework uses this list to figure out which controllers it has access to, it chops off the Controller suffix from all of the controller class names.
·         So, whenever you need to refer to a controller, you do so by its shortened name, e.g.,  AuctionsController is referred to as Auctions, and Home Controller becomes Home.
·         What’s more, the controller and action values in a route are not case-sensitive. This means that each of these requests—/Auctions/Recent, /auctions/Recent, /auctions/recent, or even /aucTionS/rEceNt—will successfully resolve to the Recent action in the AuctionsController.
·         Note: URL route patterns are relative to the application root, so they do not need to start with a forward slash (/) or a virtual path designator (~/).
·         Route patterns that include these characters are invalid and will cause the routing system to throw an exception.
·         As you may have noticed, URL routes can contain a wealth of information that the routing engine is able to extract.
·         In order to process an ASP.NET MVC request, however, the routing engine must be able to determine two crucial pieces of information: the controller and the action.

·         The routing engine can then pass these values to the ASP.NET MVC runtime to create and execute the specified action of the appropriate controller.