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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. script in C#

script in C#

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

    hi all i want the page to display a message, i knw hw to do it by script, but hw to make the ASP code calls the script method as i wrire the code in the code behind page not in the HTML page thank u abdelhameed81

    F 1 Reply Last reply
    0
    • A abdelhameed81

      hi all i want the page to display a message, i knw hw to do it by script, but hw to make the ASP code calls the script method as i wrire the code in the code behind page not in the HTML page thank u abdelhameed81

      F Offline
      F Offline
      Fedor Hajdu
      wrote on last edited by
      #2

      Hi, you can use Page.RegisterClientScriptBlock() method to register client scripts.

      A 1 Reply Last reply
      0
      • F Fedor Hajdu

        Hi, you can use Page.RegisterClientScriptBlock() method to register client scripts.

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

        thank u but i tried the following code if (!Page.IsClientScriptBlockRegistered("mytest") ) Page.RegisterClientScriptBlock("myrest", "alert('Hello');"); but not work abdelhameed81

        M 1 Reply Last reply
        0
        • A abdelhameed81

          thank u but i tried the following code if (!Page.IsClientScriptBlockRegistered("mytest") ) Page.RegisterClientScriptBlock("myrest", "alert('Hello');"); but not work abdelhameed81

          M Offline
          M Offline
          MIHAI_MTZ
          wrote on last edited by
          #4

          it works ok here; although you wrote "myrest" the seccond time.

          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