Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4617034
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:04:03+00:00 2026-05-22T02:04:03+00:00

I have code in View: @using (Html.BeginForm(MyAction, MyController) { <input type=text id=txt /> <input

  • 0

I have code in View:

@using (Html.BeginForm("MyAction", "MyController")
{
    <input type="text" id="txt" />          
    <input type="image" src="/button_save.gif" alt="" />
}

How can I pass value of txt to my controller:

[HttpPost]
public ActionResult MyAction(string text)
{
 //TODO something with text and return value...
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:04:04+00:00Added an answer on May 22, 2026 at 2:04 am

    Give your input a name and make sure it matches the action’s parameter.

    <input type="text" id="txt" name="txt" />
    
    [HttpPost]
    public ActionResult MyAction(string txt)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code in the View: <script src=../../Scripts/jquery.form.js type=text/javascript></script> <script src=../../Scripts/jquery-1.5.1.js type=text/javascript></script> <script
I have the following code in a MVC view: <% using (Html.BeginForm()) { %>
Using MVC, I have an html form helper in my view: using (Html.BeginForm(ActionOne, ControllerOne))
I have a view to create a user as follows. <% using (Html.BeginForm(SaveUser, Security))
I have the following code in a partial view (using Spark): <span id=selectCount>0</span> video(s)
I have created an alert view with two buttons using the following code: UIAlertView
I am using vb.net code. I have grid view, please see the code below:
i have the following code in an asp.net mvc view. <% = Html.DropDownList(Filter, new
I have this code for Form Submit.. <input type=submit runat=server id=buttonSubmit value=Add style=width:100px; />
In my html I have <h2>Title goes here</h2> @using (Html.BeginForm(Action, Controller, FormMethod.Post, new {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.