.Net Interview Questions and Answers

Search:

How can you handle multiple submit buttons? (ASP.NET MVC Interview Questions)

By : Shiv Prasad Koirala | Dec 23rd, 2014 | Views : 5516 | Comments : 0 Bookmark and Share

Let us try to understand what the interviewer is asking.


If you have two submit buttons as shown in the below code and you want that when end user click first submit button, "X" action should fire and in the other submit button click "Y" action should fire. What is the best way to achieve the same?.



The first way is by creating two form tags and every submit button goes in to those individual form tags as shown in the below code. So if you click on submit button "sub1" it will post to "Action1" and if the end user clicks on "sub2" it will post to "Action2".




In case the interviewer complains that the above approach is not AJAX. Then you can give the below Javascript and JQUERY approach. So in every submit button click we are invoking their respective functions and in their respective functions we are invoking JQUERY POST's.




Do not forget to download our 100 ASP.NET MVC Interview question ebook


If you are completely new to ASP.NET MVC you can start with below free youtube video which teaches MVC 5 from scratch.


 
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