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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Page refresh problem.

Page refresh problem.

Scheduled Pinned Locked Moved ASP.NET
helpquestion
8 Posts 4 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.
  • A Offline
    A Offline
    absprogrammer
    wrote on last edited by
    #1

    hi, I am using imagebutton. On clickevent of imagebutton i am opening a popup window. but problem is that when i click imagebutton first time, then i close popup window. but after that if i refresh page that popup is again open. which i dont want. And this is happen with all of my imagebutton. can anybody help me?:confused: thanx in advance.

    M E H 3 Replies Last reply
    0
    • A absprogrammer

      hi, I am using imagebutton. On clickevent of imagebutton i am opening a popup window. but problem is that when i click imagebutton first time, then i close popup window. but after that if i refresh page that popup is again open. which i dont want. And this is happen with all of my imagebutton. can anybody help me?:confused: thanx in advance.

      M Offline
      M Offline
      Mircea Grelus
      wrote on last edited by
      #2

      Can you post the code? regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

      A 1 Reply Last reply
      0
      • A absprogrammer

        hi, I am using imagebutton. On clickevent of imagebutton i am opening a popup window. but problem is that when i click imagebutton first time, then i close popup window. but after that if i refresh page that popup is again open. which i dont want. And this is happen with all of my imagebutton. can anybody help me?:confused: thanx in advance.

        E Offline
        E Offline
        enjoycrack
        wrote on last edited by
        #3

        Are u using onclick event at client side or server side in this case? << >>

        A 1 Reply Last reply
        0
        • A absprogrammer

          hi, I am using imagebutton. On clickevent of imagebutton i am opening a popup window. but problem is that when i click imagebutton first time, then i close popup window. but after that if i refresh page that popup is again open. which i dont want. And this is happen with all of my imagebutton. can anybody help me?:confused: thanx in advance.

          H Offline
          H Offline
          HimaBindu Vejella
          wrote on last edited by
          #4

          Try this Use if(!IsPostBack) While u open window Senior Software Engineer Nothing is Impossible Even Impossible says I'M POSSIBLE

          1 Reply Last reply
          0
          • M Mircea Grelus

            Can you post the code? regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

            A Offline
            A Offline
            absprogrammer
            wrote on last edited by
            #5

            here code -------------------- Private Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click upload_mail() End If Sub upload_mail() Dim query As String = "select client_email_id from n_client_info where id = " & Request.QueryString("clientkey_id") Dim strScript As String = "window.location =" & "'mailto:financial@ibhsolves.com'" & ";" & "</" + "script>" RegisterClientScriptBlock("anything", strScript) End Sub </x-turndown>

            M 1 Reply Last reply
            0
            • E enjoycrack

              Are u using onclick event at client side or server side in this case? << >>

              A Offline
              A Offline
              absprogrammer
              wrote on last edited by
              #6

              thanx server side onclick event

              E 1 Reply Last reply
              0
              • A absprogrammer

                thanx server side onclick event

                E Offline
                E Offline
                enjoycrack
                wrote on last edited by
                #7

                if you use asp:button, its type is submit button, that why your page get refreshed when user clicks on it. So you should inject a js code for onclick event of the button to process this event at client side e.g: button.Attributes.Add("onclick","return YourFunc();") and you just simply implement yourFunc() to open a new window and remmember add "return false;" statement to tell the client that no need to post back Hope u got the idea << >>

                1 Reply Last reply
                0
                • A absprogrammer

                  here code -------------------- Private Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click upload_mail() End If Sub upload_mail() Dim query As String = "select client_email_id from n_client_info where id = " & Request.QueryString("clientkey_id") Dim strScript As String = "window.location =" & "'mailto:financial@ibhsolves.com'" & ";" & "</" + "script>" RegisterClientScriptBlock("anything", strScript) End Sub </x-turndown>

                  M Offline
                  M Offline
                  Mircea Grelus
                  wrote on last edited by
                  #8

                  Please post the entire code. What you have posted doesn't make any sense. Why are you adding " RegisterClientScriptBlock("anything", strScript) to the client script? RegisterClientScriptBlock is an ASP.NET (serverside) function. Not Javascript (clientside). regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are. -- modified at 13:14 Wednesday 1st March, 2006

                  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