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 8317515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:37:51+00:00 2026-06-08T21:37:51+00:00

In PHP, one can immediately stop the execution of the script and output a

  • 0

In PHP, one can immediately stop the execution of the script and output a variable. For instance if you want to know what’s in $myVar, you could do:

var_dump($myVar); die();

Is there anyway to immediately get the value of a variable and then kill it in VB.NET?

I’m not asking for a function to include necessarily; just if there is a native function that will basically output a var immediately, without me having to add it to the controller, then the view, then publish and test. Ideally, it would just output the variable in a debugger or messagebox or something…

I am also using ASP.NET MVC 3.

Thanks.

  • 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-08T21:37:52+00:00Added an answer on June 8, 2026 at 9:37 pm

    You can use the System.Diagnostics.Trace and System.Diagnostics.Debug classes to print out information.

    Stopping the execution typically occurs by either returning a relevant System.Web.Mvc.ActionResult, such as System.Web.Mvc.HttpNotFoundResult or by throwing a System.Web.HttpException with the HTTP status code which best describes the problem.

    Here’s a naive example. Excuse my poor VB.

    Public Function UpdateUser(id as Integer, userName as String, password as Password) as ActionResult
        Dim user as User = DataServices.GetUserById(id)
        If user Is Nothing Then
            System.Diagnostics.Debug.WriteLine("Aborting because user did not exist.")
            throw new HttpException(404, "Page not found.")
        End
        ' Do more stuff
    end
    

    Or in C#

    public ActionResult UpdateUser(int id, string userName, string password) {
        var user = DataServices.Users.Where(u => u.id == id).SingleOrDefault();
    
        if( user == null ) {
            Debug.WriteLine("Aborting because user did not exist.");
            return HttpNotFound(); // Helper method in Controller Class.
        }
        else if( myRoles() < thisUsersRoles(user) ) {
            Debug.Writeline("Aborting because insufficient access.");
            throw new HttpException(401, "Unauthorized");
        }
    
        // update user here
        return View();
    }
    

    Note that these examples are contrived only to display the use of Debug and the return of http status codes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I post a php variable from one file to an other? I
In PHP one can create a reference variable, so that two named variables can
In PHP, one can do foreach($array as $key=>$value){//codes . Is it possible to create
How to install the oauth in php. Can any one provide me the full
I am creating a process using proc_open in one PHP script. How do i
Iam working on Ubuntu.(Linux) I want to redirect from the page one.php to two.php,
In PHP one can use the function preg_match with the flag PREG_OFFSET_CAPTURE in order
I know this seems like I should have immediately found the one example out
okey so here is my structure. one.php two.php three.php one.php includes both two.php and
i have one php file which process adding of record in Database fro array.

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.