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. calling javascript function written in separate js file to validate contentpage controls which inherits masterpage

calling javascript function written in separate js file to validate contentpage controls which inherits masterpage

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

    I want to validate each page controls which is inherited from master page. i call this javascript in master page, it is not working, my question is how can we pass each page id to the javascript function when we run the website all the pages form id is showing as aspnetForm.

    A 1 Reply Last reply
    0
    • R Robymon

      I want to validate each page controls which is inherited from master page. i call this javascript in master page, it is not working, my question is how can we pass each page id to the javascript function when we run the website all the pages form id is showing as aspnetForm.

      A Offline
      A Offline
      anujbanka1784
      wrote on last edited by
      #2

      call this function and simply add the id of some control.. like i have on button control ... btn_add.Attributes.Add("onclick", "return abc('" + fu_file.ClientID + "','"+ddl_sub.ClientID+"');"); i call a function which is on master page and pass two id of two controls.. and in fuction use this id and do watever u want to do.

      R 1 Reply Last reply
      0
      • A anujbanka1784

        call this function and simply add the id of some control.. like i have on button control ... btn_add.Attributes.Add("onclick", "return abc('" + fu_file.ClientID + "','"+ddl_sub.ClientID+"');"); i call a function which is on master page and pass two id of two controls.. and in fuction use this id and do watever u want to do.

        R Offline
        R Offline
        Robymon
        wrote on last edited by
        #3

        what is this fu_file.ClientID and ddl_sub.ClientID. Is it a controls id, then how the javascript file find the form of this controls. what is "fu_file" and what is "ClientID"

        A 1 Reply Last reply
        0
        • R Robymon

          what is this fu_file.ClientID and ddl_sub.ClientID. Is it a controls id, then how the javascript file find the form of this controls. what is "fu_file" and what is "ClientID"

          A Offline
          A Offline
          anujbanka1784
          wrote on last edited by
          #4

          they find id of these controls and u can find id of any control and in java script u can get id of any control like this function abc(ID,id) { return confirm('Are you sure you want to save the file '+ document.getElementById(ID).value + ' in process '+document.getElementById(id).value+ "." ); }

          R 1 Reply Last reply
          0
          • A anujbanka1784

            they find id of these controls and u can find id of any control and in java script u can get id of any control like this function abc(ID,id) { return confirm('Are you sure you want to save the file '+ document.getElementById(ID).value + ' in process '+document.getElementById(id).value+ "." ); }

            R Offline
            R Offline
            Robymon
            wrote on last edited by
            #5

            Thanks

            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