[ Log On ]
< <


Submitted by:sushant Gawas
11/24/2014 12:00:00 AM
Language: Programming

Clickjacking, also known as a "UI redress attack", is when an attacker uses multiple transparent or opaque layers to trick a user into clicking on a button or link on another page when they were intending to click on the the top level page. Thus, the attacker is "hijacking" clicks meant for their page and routing them to another page, most likely owned by another application, domain, or both.

Using a similar technique, keystrokes can also be hijacked. With a carefully crafted combination of stylesheets, iframes, and text boxes, a

Submitted by:P.K
1/5/2014 12:00:00 AM
Language: MVC

    <script language="javascript" type="text/javascript">
        var editid;
        var count = 0;
        var incld = "";
        var i = 0;
        $(document).ready(function() {




        function GattableList() {

            function(data) {
            $(".btnEdit").bind("click", Edit);
            $(".chka").bind("click", checkUncchk);
        function Edit() {

            if (count == 0) {

                var par = $(this).parent().parent(); //tr
                //var d = $('#tblt tr td').attr('id');
                var ed;
                var tdButtons = par.children("td:nth-child(1)");
                var tdInclude = par.children("td:nth-child(2)");
                var tdBinderType = par.children("td:nth-child(3)");
                var tdNoteType = par.children("td:nth-child(4)");
                var tdQuickNotes = par.children("td:nth-child(5)");
                // tdInclude.html("<input type='checkbox' id='incl' >");
                $("#tblt tr td:nth-child(1)").click(function() {
                eid = $(this).attr('id');
                    eid = eid.trim();
                    var tempinc = new Array();
                    tempinc = eid.split("/");
                    i = tempinc[0];
                    incld = tempinc[1]

                    tdButtons.html("<button class='btn btn-danger btn-small' Onclick='Save(" + i + ");'>Save</buton>" + "&nbsp" +
             "<button class='btn btn-danger btn-small' Onclick='Loadgrd();'>Cancel</buton>");
             if (incld.trim() == "True") {

             tdInclude.html('<label><input type="checkbox" id="incl"></label>');
                    $('#incl').attr("checked", "checked");
                else {
                    tdInclude.html('<label><input type="checkbox" id="incl"></label>');


//                //alert(eid);
//                var inc = tdInclude.html();
//                alert(inc);
//                //var dc = document.getElementById('Include').checked

//                //            var inld = $("#Include").attr("checked");
//                //            alert(inld);
//                            if (inc.trim() == "True") {
//                     &nb

Submitted by:P.K.S
8/17/2013 12:00:00 AM
Language: MVC

1. Can you describe ASP.NET MVC Request Life Cycle?

Ans. There are two answers for the question.

Short Answer: Following are the steps that are executed in ASP.NET MVC Request

Life Cycle.

I. Receive request, look up Route object in RouteTable collection and create

RouteData object.

II. Create RequestContext instance.

III. Create MvcHandler and pass RequestContext to handler.

IV. Identify IControllerFactory from RequestContext.

V. Create instance of class that implements ControllerBase.

VI. Call MyController.Execute method.

VII. The ControllerActionInvoker determines which action to invoke on the controller

and executes the action on the controller, which results in calling the model and

returning a view.

Detailed Answer: There are five main steps occurs in ASP.NET Request Life


I. Initialize Application (Route table is created)

Desc. When we request a page from a normal ASP.NET application, there is a

physical copy of page on the disk that is corresponds to each page request. In

ASP.NET MVC, there is no page on the disk that corresponds to the request.

Request is routed to the controller. The controller is responsible for generating page

that is sent back to the browser.

ASP.NET MVC has Route Table which stores mapping entries of particular URLs to

action methods of contoller. i.e. URL “” maps to

the “CSharp” method of “Articles” controller.

In ASP.NET MVC application like normal ASP.NET application when application

starts first time, it calls Application_Start() application event from Global.asax. Route

table is registered(created) from Appication_Start() event.

II. Routing Mechanism (UrlRoutingModule intercepts the request)

When a request is coming to ASP.NET MVC application, the request is intercepted

by UrlRoutingModule HTTP Module. The first thing the module does is to wrap up the

current HttpContext in an HttpContextWrapper2 object. Next, the module passes the

wrapped HttpContext to the RouteTable that was setup in the previous step, which

includes includes the URL, form parameters, query string parameters, and cookies

associated with the current request.

Next, the module creates a RouteContext object that represents the current

HttpContext and RouteData. The module then instantiates a new HttpHandler based

on the RouteTable and passes the RouteContext to the new handler’s constructor(In

ASP.NET MVC case it is MvcHandler).

Last step taken by module is setting MvcHandler as the current HTTP Handler.

III. MvcHandler Executes (Instantiate and execute controller)

In normal ASP.NET application after second step, it fires set of events including

Start, BeginRequest, PostReso

Submitted by:Archana
8/17/2013 12:00:00 AM
Language: MVC

What is difference between jQuery's ready and holdReady?
jQuery's ready is an event which gets triggered automatically when DOM is ready while holdReady is a signal/flag to hold this triggering. holdReady was included in 1.6 version and it works only if used before the execution/triggering of ready event. Once ready event is fired, it has nothing to do. It is useful in dynamically loading scripts before the ready starts. It release ready event execution when used with a true parameter. 

What is Jquery $.ajax() method?
The Jquery ajax() method is used to perform an AJAX (asynchronous HTTP) request.

Name any four paremeter of Jquery ajax method?
url : Specifies the URL to send the request to. Default is the current page
type : Specifies the type of request. (GET or POST)
data : Specifies data to be sent to the server
cache: A Boolean value indicating whether the browser should cache the requested pages. Default is true
beforeSend(xhr): A function to run before the request is sent

When can you use jQuery?
JQuery can be used to perform
1.Call methods on specific events
2.Traverse the documents
3.For apply CSS
4.Manipulation purpose and
5.To add effects too.
6.For apply animations
7.For give atractive look (dialogbox etc)
8.For asynchronous calls ($.ajax())

.What is the use of noConflict() method in Jquery?

How to select combobox selecte value and text using Jquery?
var StateID = $("#StateCbx").val(); // Or you can use it $("#iStateID").val();
var StateName = $("#StateCbx option:selected").text();
alert("Selected combobox text is= " + StateName + " and value is= " + StateID);

JQuery html() method works for both HTML and XML documents?
No, It only works for HTML

Submitted by:P.K.R
5/16/2013 12:00:00 AM
Language: MVC



MVC means ?


MVC stands for Model View Controller.
It divides an application into 3 component roles which is based on a framework methodology.
These component roles are discussed briefly as follows:

i) Models : These component roles are used to maintain the state which is persisted inside the Database.

Example: we might have a Product class that is used to represent order data from the Products table inside SQL.

ii) Views : These component roles are used to display the user interface of the application, where this UI is created off of the model data.

Example: we might create an Product “Edit” view that surfaces textboxes, dropdowns and checkboxes based on the current state of a Product object.

iii) Controllers : These component roles are used for various purposes like handling end user interaction, manipulating the model, and ultimately choosing a view to render to display UI.


In a MVC application, the views are used only for displaying the information whereas the controllers are used for handling and responding to user input and interaction.


Which assembly is used to define the MVC framework and Why ?


The MVC framework is defined through System.Web.Mvc assembly.
This is because this is the only assembly which contains classes and interfaces that support the ASP.NET Model View Controller (MVC) framework for creating Web applications.


How can we plug an ASP.NET MVC into an existing ASP.NET application ?


We can combine ASP.NET MVC into an existing ASP.NET application by following the below procedure:

First of all, you have to add a reference to the following three assemblies to your existing ASP.NET application:

i) System.Web.Routing
ii) System.Web.Abstractions
iii) System.Web.Mvc

The ASP.NET MVC folder should be created after adding these assembly references.
Add the folder Controllers, Views, and Views | Shared to your existing ASP.NET application.
And then you have to do the necessary changes in web.config file.
For this you can refer to the below link:


What are the advantages of using mvc ?


The main advantages of using mvc are as follows:

i) One of the main advantage is that it will be easier to manage the complexity as the application is divided into model,view and controller.
ii) It gives us the full control over the behavior of an application as it does not use view state or server-based forms.
iii) It provides better support for test-driven development (TDD).
iv) You can design the application with a rich routing infrastructure as it uses a Front Controller pattern that processes Web application requests through a single controller.


Explain about Razor View Engine ?


This Razor View engine is a part of new rendering framework for ASP.NET web pages.
ASP.NET rendering engine uses opening and closing brackets to denote code (<% %>), whereas Razor allows a cleaner, implied syntax for determining where code blocks start and end.


In the classic renderer in ASP.NET:


<% foreach (var userTicket in Model)

  { %>

    <li><%: userTicket.Value %></li>

<%  } %>



By using Razor:


@foreach (var userTicket in Model)







Does the unit testing of an MVC application is possible without running controllers in an ASP.NET process ?


In an MVC application, all the features are based on interface. So, it is easy to unit test a MVC application.
And it is to note that, in MVC application there is no need of running the controllers for unit testing.


Which namespace is used for ASP.NET MVC ?


System.Web.Mvc namespace contains all the interfaces and classes which supports ASP.NET MVC framework for creating web applications.


Can we share a view across multiple controllers ?


Yes, It is possible to share a view across multiple controllers by putting a view into the shared folder.
By doing like this, you can automatically make the view available across multiple controllers.


What is the use of a controller in an MVC applicatio ?


A controller will decide what to do and what to display in the view. It works as follows:

i) A request will be received by the controller
ii) Basing on the request parameters, it will


Share Your Source Code or Article

Do you have source code, articles, tutorials, web links, and books to share? You can write your own content here. You can even have your own blog.

Submit now...