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

  • SEARCH
  • Home
  • 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 8791393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:50:12+00:00 2026-06-13T22:50:12+00:00

The Tools Used: VB.NET 2012, MVC 4, Visual Studio 2012 The Controller: SubmitFormController.vb Namespace

  • 0

The Tools Used: VB.NET 2012, MVC 4, Visual Studio 2012

The Controller: SubmitFormController.vb

Namespace MvcApplication19
    Public Class UserNamePrintOutSubmitClassController
        Inherits System.Web.Mvc.Controller

        ' This method will handle GET
        Function Technology() As ActionResult
            Return View("Technology")
        End Function

        ' This method will handle POST
        <HttpPost>
        Function UserNamePrintOut() As ActionResult
            ' Do something
            Response.Write("Hello " & Request.QueryString("UserName") & "<br />")
            Return View()
        End Function
    End Class
End Namespace

The View: Technology.vbhtml

The URL: http://localhost/Home/Technology/

<form action="" method="post">
    <input type="text" name="UserName" />
    <input type="submit" name="UserName_submit" value="Print It Out!" />
</form>

The Question

I do not have a model in this example. The intention is to have the UserName submitted with the submit button and have it printed on the screen, on page load. Which means, the UserName should get passed to the action method and get printed on the screen.

I am having no error messages, nevertheless, the UserName does not get printed on the screen, perhaps, somebody, can have look at the code above.

I have been trying this with tutorials, which are often in C#. My background has been PHP, and I still tend to think in terms of “echo” – yet, I am getting used to MVC 4.

  • 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-06-13T22:50:13+00:00Added an answer on June 13, 2026 at 10:50 pm

    You’re using ASP.NET MVC, not WebForms; however the concept of “postback” is unique to WebForms. It’s like using System.Windows.Forms when you’re actually using WPF.

    In MVC you have different methods for each verb, you should rewrite it as follows:

    Public Class SubmissionFormController
        Inherits System.Web.Mvc.Controller
    
        ' This method will handle GET
        Function UserNamePrintOut() As ActionResult
            Return View() ' Avoid using Response.Write in a controller action method, as the method is not being called in an appropriate place. Anything returned will be at the start of the response.
        End Function
    
        ' This method will handle POST
        <HttpPost>
        Function UserNamePrintOut(FormValueCollection post) As ActionResult
            ' Do something
            Return View()
        End Function
    
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Visual Studio 2012, I created a new ASP.NET MVC 4 web project, using
We are developing a windows application in .NET(C#) IDE used is Visual Studio 2008.
I'm working on a .NET class that will be used in tools to manage
Being a .NET developer, I used Visual SourceSafe that comes bundled with Visual Studio.
I have a project that targets .NET 4.5. In Visual Studio 2012, I can
Now that .NET 4.5 and Visual Studio 2012 has RTM, is there a way
In every Visual Studio.NET version you can set keyboard shortcuts using menu Tools ->
How can I check what objects, tools, variables, anything... are used from .NET 2.0
Does anybody know what tool used while podcasts were recorded here: http://www.asp.net/mvc/application-development/ For example
What feature(s) of ASP.Net MVC can replace the way events can be used in

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.