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. Adding multiple attributes to one control event

Adding multiple attributes to one control event

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
5 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.
  • G Offline
    G Offline
    Grapes R Fun
    wrote on last edited by
    #1

    Does anyone know how to add multiple attributes (e.g. client function names) to one specific event? Im looking for a way to do this: ((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", "function1();"); Then from a different page, add this: ((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", "function2();"); Without writing over the existing attribute, because that's what it is doing now :-( Any help is much appreciated!

    Nila "...for that, I will need a large cup of coffee and a bran muffin!" -Samantha Bea

    N 1 Reply Last reply
    0
    • G Grapes R Fun

      Does anyone know how to add multiple attributes (e.g. client function names) to one specific event? Im looking for a way to do this: ((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", "function1();"); Then from a different page, add this: ((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", "function2();"); Without writing over the existing attribute, because that's what it is doing now :-( Any help is much appreciated!

      Nila "...for that, I will need a large cup of coffee and a bran muffin!" -Samantha Bea

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      string OnLoadString = ((HtmlControl)Master.FindControl("masterBody")).Attributes["onload"]; ((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", removed + "function2();"); Unless I'm missing something removed is actually OnLoadString but CP changes it


      only two letters away from being an asset

      G 1 Reply Last reply
      0
      • N Not Active

        string OnLoadString = ((HtmlControl)Master.FindControl("masterBody")).Attributes["onload"]; ((HtmlControl)Master.FindControl("masterBody")).Attributes.Add("onload", removed + "function2();"); Unless I'm missing something removed is actually OnLoadString but CP changes it


        only two letters away from being an asset

        G Offline
        G Offline
        Grapes R Fun
        wrote on last edited by
        #3

        You ARE and asset! Thanks for the tip, I can be clueless sometimes :-O

        Nila "...for that, I will need a large cup of coffee and a bran muffin!" -Samantha Bea

        N 1 Reply Last reply
        0
        • G Grapes R Fun

          You ARE and asset! Thanks for the tip, I can be clueless sometimes :-O

          Nila "...for that, I will need a large cup of coffee and a bran muffin!" -Samantha Bea

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          Sometimes I need to be reminded of the simple things also.


          only two letters away from being an asset

          G 1 Reply Last reply
          0
          • N Not Active

            Sometimes I need to be reminded of the simple things also.


            only two letters away from being an asset

            G Offline
            G Offline
            Grapes R Fun
            wrote on last edited by
            #5

            i hear ya... remember debugging for hours just to find out you are missing that d*mn semicolon?!? ;P

            Nila "...for that, I will need a large cup of coffee and a bran muffin!" -Samantha Bea

            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