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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:49:17+00:00 2026-06-04T16:49:17+00:00

I have a little app that initially requests a user id. This user id

  • 0

I have a little app that initially requests a user id. This user id is then sent as a parameter to a stored procedure that returns values from a database. What I would like for this app to do is to refresh those same values every 30 seconds. My issue is that when I refresh, I lose the user id. Is there something simple that I’m missing here?

public ActionResult Report()
{

  string operatorCode = Request.Form.GetValues("txtOperator")[0].ToString();

  ViewBag.operatorName = (from e in db.employees
                          where e.operator_code == operatorCode
                          select e.name).Max().ToString();            

  ViewData["operatorCode"] = operatorCode;            

  var results =  db.lex_sp_Select_Paintline_FinRew_Operator(operatorCode);

  Response.AddHeader("Refresh", "10");

  return View(results.ToList());
}
  • 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-04T16:49:18+00:00Added an answer on June 4, 2026 at 4:49 pm

    I think the main reason for the null value is due to the fact that you are trying to refresh an HttpPost, rather than a request (the refresh header is not intended for POSTS). I’d suggest as an alternative, that you change your process to be a request, which would result in only needing to change the invoking code (to a get) and changing the Report action to:

    string operatorCode = Request.QueryString["txtOperator"];
    

    this should give you the desired result, tho at the expense of the action now being a get rather than a post. You could also store the operatorCode in Session (tho this may not scale very well). The final option that I can see, would be to run an ajax request on a setInterval() and use that process to send a POST to the controller action.

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

Sidebar

Related Questions

I have a little one-liner in my Rails app that returns a range of
I have a little web app that uses the Facebook like widget. This page
I have a simple little email app that allows a user to pick certain
I have a little app that have by default youtube as homepage. You can
I have a little app up that has both CCLayer view and UIView. That
I have a little iOS5 app that shows images. I click on the image
I am learning flex and have written a little app with a TextArea that
I have little Silverlight app that needs to make queries to server, is it
I have coded a little app that does something like the following: sprintf(command, ......sending
I have a nice little app on the app store that does pretty well

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.