Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Click Event Fires During Form Load

Click Event Fires During Form Load

Scheduled Pinned Locked Moved ASP.NET
csharpdebugginghelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hemant Mane
    wrote on last edited by
    #1

    i created simple project using C# and added one textbox and button now i write code "TextBox1.Text = DateTime.Now.ToLongTimeString();" in button event and set breakpoint on this line now when i click on button in runtime event fires and textbox1.text becomes current time and breakepoint got yellow but now when i click on refresh the same event fires again plzzz help me aj

    M 1 Reply Last reply
    0
    • H Hemant Mane

      i created simple project using C# and added one textbox and button now i write code "TextBox1.Text = DateTime.Now.ToLongTimeString();" in button event and set breakpoint on this line now when i click on button in runtime event fires and textbox1.text becomes current time and breakepoint got yellow but now when i click on refresh the same event fires again plzzz help me aj

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      If you click Refresh like that, it's entirely the same as you click the button again. If you don't want that to happen, you may simply call the Response.Redirect method by the end of the click event handler:

      Response.Redirect(Request.Url.AbsoluteUri);

      However, you need to keep necessary information in order for the page to display correctly when the page is reloaded after the Response.Redirect method executes.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups