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. Update Panel and Registerstartupscript Bug...........

Update Panel and Registerstartupscript Bug...........

Scheduled Pinned Locked Moved ASP.NET
helptoolsannouncement
5 Posts 3 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.
  • S Offline
    S Offline
    sandesh khare
    wrote on last edited by
    #1

    Hi every one I am facing a problem in my current project. The problem is I am unable to use RegisterStartupscript with the Update panel. The script does not run and I am unable to see it in the view source . These are the codes which i have tried. ScriptManager.RegisterStartupScript(this, this.GetType(), "Success", builder.ToString(), false); up->updatepanel ScriptManager.RegisterStartupScript(up1, up1.GetType(), "hello", "alert('Hello!')", true); ClientScript.RegisterStartupScript(this.GetType(), argScriptId, builder.ToString(),true); These all I have tried but nothing seems to be working. however If i remove the updatepanel then I am able to see the script in view source. and the code is running fine. Please send me the solution if any one have. Sandesh Khare :(( Software Enginner ISTS Infotech Solutions

    V 1 Reply Last reply
    0
    • S sandesh khare

      Hi every one I am facing a problem in my current project. The problem is I am unable to use RegisterStartupscript with the Update panel. The script does not run and I am unable to see it in the view source . These are the codes which i have tried. ScriptManager.RegisterStartupScript(this, this.GetType(), "Success", builder.ToString(), false); up->updatepanel ScriptManager.RegisterStartupScript(up1, up1.GetType(), "hello", "alert('Hello!')", true); ClientScript.RegisterStartupScript(this.GetType(), argScriptId, builder.ToString(),true); These all I have tried but nothing seems to be working. however If i remove the updatepanel then I am able to see the script in view source. and the code is running fine. Please send me the solution if any one have. Sandesh Khare :(( Software Enginner ISTS Infotech Solutions

      V Offline
      V Offline
      Venkatesh Mookkan
      wrote on last edited by
      #2

      sandesh khare wrote:

      ScriptManager.RegisterStartupScript(this, this.GetType(), "Success", builder.ToString(), false); up->updatepanel ScriptManager.RegisterStartupScript(up1, up1.GetType(), "hello", "alert('Hello!')", true); ClientScript.RegisterStartupScript(this.GetType(), argScriptId, builder.ToString(),true); These all I have tried but nothing seems to be working.

      This would work only if the Page postbacks. But in AJAX, no postbask is going to happen. You have try with Client Scripting provided by the Script Manager like,

      Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(funcBeginRequest);
      Sys.WebForms.PageRequestManager.getInstance().add_endRequest(funcEndRequest);
      
      function funcBeginRequest(){
      }
      
      function funcEndRequest(){
      }
      

      Similarly for Page onload (StartupScript) can also be handler using add_pageLoad() method. Refer Client Scripting help in www.asp.net

      [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

      S 1 Reply Last reply
      0
      • V Venkatesh Mookkan

        sandesh khare wrote:

        ScriptManager.RegisterStartupScript(this, this.GetType(), "Success", builder.ToString(), false); up->updatepanel ScriptManager.RegisterStartupScript(up1, up1.GetType(), "hello", "alert('Hello!')", true); ClientScript.RegisterStartupScript(this.GetType(), argScriptId, builder.ToString(),true); These all I have tried but nothing seems to be working.

        This would work only if the Page postbacks. But in AJAX, no postbask is going to happen. You have try with Client Scripting provided by the Script Manager like,

        Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(funcBeginRequest);
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(funcEndRequest);
        
        function funcBeginRequest(){
        }
        
        function funcEndRequest(){
        }
        

        Similarly for Page onload (StartupScript) can also be handler using add_pageLoad() method. Refer Client Scripting help in www.asp.net

        [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

        S Offline
        S Offline
        Sandeep Akhare
        wrote on last edited by
        #3

        BOTs - running in my mind wrote:

        This would work only if the Page postbacks. But in AJAX, no postbask is going to happen.

        Hi Venkat, Here i am getting confused, even if you are using ajax postback is going to heppen it will go to page load and you can see isPostback property that will show you true ... In what sence you are saying that postback is not going to happen ?

        Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

        V 1 Reply Last reply
        0
        • S Sandeep Akhare

          BOTs - running in my mind wrote:

          This would work only if the Page postbacks. But in AJAX, no postbask is going to happen.

          Hi Venkat, Here i am getting confused, even if you are using ajax postback is going to heppen it will go to page load and you can see isPostback property that will show you true ... In what sence you are saying that postback is not going to happen ?

          Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

          V Offline
          V Offline
          Venkatesh Mookkan
          wrote on last edited by
          #4

          playing with bugs ) wrote:

          Here i am getting confused, even if you are using ajax postback is going to heppen it will go to page load and you can see isPostback property that will show you true ... In what sence you are saying that postback is not going to happen ?

          Hi Sandeep, You are talking about Server-side Page Load. But I mentioned the Client Side page load (onload event), since the StartupScript is going to do the same.

          [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

          S 1 Reply Last reply
          0
          • V Venkatesh Mookkan

            playing with bugs ) wrote:

            Here i am getting confused, even if you are using ajax postback is going to heppen it will go to page load and you can see isPostback property that will show you true ... In what sence you are saying that postback is not going to happen ?

            Hi Sandeep, You are talking about Server-side Page Load. But I mentioned the Client Side page load (onload event), since the StartupScript is going to do the same.

            [Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot

            S Offline
            S Offline
            Sandeep Akhare
            wrote on last edited by
            #5

            Yup OK that's what i got confused :)

            Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

            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