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. send alert message from child ascx to the parent page

send alert message from child ascx to the parent page

Scheduled Pinned Locked Moved ASP.NET
question
4 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.
  • N Offline
    N Offline
    netJP12L
    wrote on last edited by
    #1

    Hi, I want to send a message to the parent page when a button is click on the ascx control. How can i accomplish this? Thanks

    R T P 3 Replies Last reply
    0
    • N netJP12L

      Hi, I want to send a message to the parent page when a button is click on the ascx control. How can i accomplish this? Thanks

      R Offline
      R Offline
      raju melveetilpurayil
      wrote on last edited by
      #2

      form ascx page button click do something like this. parent.document.getElementById("ParentControlID").value="your message";

      Raju.M

      1 Reply Last reply
      0
      • N netJP12L

        Hi, I want to send a message to the parent page when a button is click on the ascx control. How can i accomplish this? Thanks

        T Offline
        T Offline
        T M Gray
        wrote on last edited by
        #3

        Use events. Your user control should raise an event that your page listens for. Events and Delegates simplified[^]

        1 Reply Last reply
        0
        • N netJP12L

          Hi, I want to send a message to the parent page when a button is click on the ascx control. How can i accomplish this? Thanks

          P Offline
          P Offline
          PunkIsNotDead
          wrote on last edited by
          #4

          in ascx codebehind add

          protected void Page_Load(object sender, EventArgs e)
          {
          Button1.Attributes.Add("OnClick", "javascript:alert('your message');");
          }

          :) try and tell us how it worked ;)

          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