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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:20:21+00:00 2026-06-07T00:20:21+00:00

I have a combo box on an MVC3 application. When a new item is

  • 0

I have a combo box on an MVC3 application. When a new item is selected it does a post back as I want it to. All fine there. In the process I pop in a querystring and read it on page load. When the page refreshes it reads the query string and sets the other controls as needed.

However, I need to detect when the page reloads, that it is as a result of a postback, as opposed to the first time the page loads. This is because when the page loads initially, everything is messed up until someone picks something from the combobox.

However, a new user to the site wont know that and will just see a mess.

I understand that MVC3 apps don’t have the same isPostback as ASP.Net has and for various reasons that I don’t understand, I know it is somehow not considered “accaptable”.

However, I am just interested in knowing if there is a 100% guaranteed reliable way to differentiate between a page first loading, and a postback in the same manner as was done in ASP.Net. If there is such a way, what is it and how can I implement it.

I have seen other post’s that do this:

    public bool IsPostBack
    {
        get
        {
            return ViewBag.IsPostBack = (Request.HttpMethod == "POST");
        }
    }

but I read other places that this is always true. So therefore if this is always true it will be true on first load too and in so being, I cant tell reliably if it is a postback or not. I know of course it is a postback of some sort. But it is not if it is a first load.

Can anyone help me with an answer to this please. Also I am using the Razor view engine as opposed to standard aspx view engines.

  • 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-07T00:20:23+00:00Added an answer on June 7, 2026 at 12:20 am

    In MVC, you typically have different actions for GET and POST:

    [HttpGet] // Actions are GET by default, so you can omit this
    public ActionResult YourAction(int id)
    {
        // GET
    }
    
    [HttpPost]
    public ActionResult YourAction(YourModel model)
    {
        // POST
    }
    

    If you follow this pattern, there is no need to worry about a Page.IsPostBack-like property.

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

Sidebar

Related Questions

in my swing application I have a combo box with an ItemListener that does
I have static combo box in html with some default value already selected and
I have a combo box in a C# Windows form application that is being
I'm using multiple threads in my application. Basically I have a combo box and
I have a combo box which displays item quantity. Based on item quantity selection
I want to have file combo box in delphi. It must behave like this:
net windows form application. I have a combo box and a text box and
I have a combo box which is of a lookup type, i.e., I've selected
I have below combo box in mvvm-wpf application. I need to implement Text search
Hi I am building a simple application that will have a combo box to

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.