• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Execute Action Method

Understanding action method execution:

2Whenever first time request is coming to sample2 view the request will go to global.asax file check the action method name and control name then control will go to the that action method in the controller execute that action method lode them controller will be return view. After executing the view result will be delivered to client.

2Even when user client on button also same action method will be called

2If we want to call the other action method from the control we use the following procedure.

Learn more about ASP.net Interview Questions in this blog post.
Interested in mastering ASP.net? Check out this blog post to learn more ASP.net Tutorials.

Step1:   create action method with same name as view name with one argument of string type as button name

Function name is we find me action method like [accept verbs (http verbs.post)]

Public action result view name (string button name)

{

Code

Return view ();

}

àIn the above example to call the own action method from button “B1”, use the following steps

Go to home controller.cs

       ↓

Write the following code [accept verbs (http.verbs.post)]

Public action result sample2 (string B1)

{

View data [“a”] =”welcome sai”;

Return view ();

}

Go to sample2.aspx

Write the add the following code in the HTML form

<%: view data [“a”] %>

Run the application and check

For indepth understanding click on

 

Summary
Review Date
Reviewed Item
Execute Action Method
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Execute Action Method"

Leave a Message

Your email address will not be published. Required fields are marked *

Site Disclaimer, Copyright © 2016 - All Rights Reserved.