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 Problem

Update Panel Problem

Scheduled Pinned Locked Moved ASP.NET
helpquestionannouncement
7 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.
  • A Offline
    A Offline
    ais07
    wrote on last edited by
    #1

    Hi There, I had Created A Message box using div tag to show error messages.It display erro messages properly.But when I try to show any error in update panel then it didn't show this error message box.Can anybody tell me what is the problem. Thanks.

    H A 2 Replies Last reply
    0
    • A ais07

      Hi There, I had Created A Message box using div tag to show error messages.It display erro messages properly.But when I try to show any error in update panel then it didn't show this error message box.Can anybody tell me what is the problem. Thanks.

      H Offline
      H Offline
      Hajab
      wrote on last edited by
      #2

      Are you trying to show an alert box from codebehind?

      1 Reply Last reply
      0
      • A ais07

        Hi There, I had Created A Message box using div tag to show error messages.It display erro messages properly.But when I try to show any error in update panel then it didn't show this error message box.Can anybody tell me what is the problem. Thanks.

        A Offline
        A Offline
        ais07
        wrote on last edited by
        #3

        Thanks For Reply, Yes.

        H 1 Reply Last reply
        0
        • A ais07

          Thanks For Reply, Yes.

          H Offline
          H Offline
          Hajab
          wrote on last edited by
          #4

          It is not possible to show an alert box from code behind on using the update panel. Update Panel just blocks these alerts. Can you provide me with the code snippet so that i shall try to help you.

          A 1 Reply Last reply
          0
          • H Hajab

            It is not possible to show an alert box from code behind on using the update panel. Update Panel just blocks these alerts. Can you provide me with the code snippet so that i shall try to help you.

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

            Thanks For Reply, Which code you want see message creation code or what? Thanks

            H 1 Reply Last reply
            0
            • A ais07

              Thanks For Reply, Which code you want see message creation code or what? Thanks

              H Offline
              H Offline
              Hajab
              wrote on last edited by
              #6

              The code you write in codebehind to display the alert

              A 1 Reply Last reply
              0
              • H Hajab

                The code you write in codebehind to display the alert

                A Offline
                A Offline
                ais07
                wrote on last edited by
                #7

                -----------------This the code which I had written in CommonClass where all my commonly used method stored.------------------------------------------------- public static void ShowMessageBox(string Message, System.Web.UI.Page p) { System.Web.UI.WebControls.Label lblMessageBox = new System.Web.UI.WebControls.Label(); lblMessageBox.Text = "" + Environment.NewLine + " void(showBox('" + Message + "'))"; p.Controls.Add(lblMessageBox); } ---------------------This is my Code Behind Code-------------------------------- CommonClass.ShowMessageBox(ex.Message.ToString(), this.Page); By using this code I am calling method present in Common Class. --------------------------And This Is My Message Box Code Which I had written On Master Page--------------------------------------- function showBox(str) { var width = document.documentElement.clientWidth + document.documentElement.scrollLeft; var layer = document.createElement('div'); layer.style.zIndex = 2; layer.id = 'layer'; layer.style.position = 'absolute'; layer.style.top = '0px'; layer.style.left = '0px'; layer.style.height = document.documentElement.scrollHeight + 'px'; layer.style.width = width + 'px'; layer.style.backgroundColor = 'LightGray'; layer.style.opacity = '.7'; layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=80)"); document.body.appendChild(layer); var div = document.createElement('div'); div.style.zIndex = 3; div.id = 'box'; div.style.position = (navigator.userAgent.indexOf('MSIE 6') > -1) ? 'absolute' : 'fixed'; div.style.top = '200px'; div.style.left = (width / 2) - (400 / 2) + 'px'; div.style.height = '100px'; div.style.width = '400px'; div.style.backgroundColor = 'White'; div.style.border = '4px solid silver'; div.style.padding = '20px'; document.body.appendChild(div); var myimg = document.createElement('IMG'); myimg.src= "../images3.jpg"; myimg.width= '50'; myimg.height = '50'; myimg.visible="true"; div.appendChild(myimg); var p = document.createElement('p'); p.innerHTML = str; p.style.position = "absolute"; p.style.top = '20px'; p.style.fontSize=14+'px'; p.style.fontWeight = "bold"; p.style.left = (width / 2) - (800 / 2) + 'px'; div.appendChild(p); v</x-turndown>

                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