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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:11:58+00:00 2026-05-11T11:11:58+00:00

Update : the clearest explanation I have found on the web as I have

  • 0

Update: the clearest explanation I have found on the web as I have been struggling through this can be found here.

Maybe I just don’t understand the model of runat server terribly well. It appears the following code is always executing the if block. If the code is running on the server side I guess I can understand that it has to be stateless.

I am a seasoned non-web programmer but it appears counter intuitive to me. Will I need to create some sort of session object or pass the current state along in the URL or what?

<script runat='server'>  DateTime begin; DateTime end; int iSelectedStart = 0; int iSelectedEnd = 0; int iPutName = 0;  protected void Button1_Click(object sender, EventArgs e) {     if (iPutName == 0)     {         iPutName = 1;         Label1.Text = TextBox1.Text + ' you will be slecting your start and end dates.'; 
  • 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. 2026-05-11T11:11:59+00:00Added an answer on May 11, 2026 at 11:11 am

    It looks like part of your code got cut off, but here’s the basic thing with web programming — it’s stateless. Unless, that is, you do something (use ViewState, Session, etc.) to add some state into the mix.

    In your case, it looks like you want to maintain some state through refreshes of the page. Put the values you want to preserve in ViewState to keep them across postbacks to the same page. If you want to hold values across pages on your site, use Session. If you want to maintain values across visits to the site, put them in a database and tie them to a login or cookie.

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

Sidebar

Related Questions

UPDATE: I've been playing around with this more, and it seems like tmux's clear-history
Update : Please file this under bad ideas. You don't get anything for free
Update: I reported this as a bug to Apple and they fixed it! All
Update : This is no longer an issue from C# 6, which has introduced
UPDATE 6/21/12 I have a form in rails that is working similar to an
Update : I found almost exact similar question , yet it has slightly different
UPDATE: I'm getting this error: (No route matches /docs/index.html... ) when accessing admin.example.com/docs/index.html The
Prescript: The amazing etherpad was recently open sourced. Get it here: http://code.google.com/p/etherpad . This
UPDATE TypeScript 1.5.3 added declarations for HTML Touch events to lib.d.ts I can see
UPDATE: Thanks for the answers! I can't seem to figure it out, even with

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.