.Net Interview Questions and Answers

Search:

How to call ASP.NET server side button click event from javascript?( ASP.NET interview questions with answers)

By : Shiv Prasad Koirala | Nov 30th, 2013 | Views : 7147 | Comments : 0 Bookmark and Share

Yes it is. In reality there in web development world there is nothing called Event. What we have it requests and responses. Client will make either get or post request to server and server in response sent back pure HTML to client.

 

Now Microsoft had created a huge abstraction over this request-response Model and made it look like Event driven model.

 

Now in order to make a post request to server they internally implemented some client scripting code along with a js method called __doPostback.

 

function __doPostBack( eventTarget, eventArgument )

    document.Form1.__EVENTTARGET.value = eventTarget;

    document.Form1.__EVENTARGUMENT.value = eventArgument;

document.Form1.submit();

}

 

If we call this method passing name (not id) of the button as an argument, it will simply leads to post request to server and Button_Click event get raised in server side.

(Second argument is - additional data associated with the control)

 

You can also watch this ASP.NET interview questions with answer video on Authentication and Authorization.

 

 
Rate this Article :
1 Star
2 Stars
3 Stars
4 Stars
5 Stars
1 1 1 2 1
 
 
 
 

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

Article Categories

Learn in Hindi