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. can javascript method call another method in a c# script?

can javascript method call another method in a c# script?

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

    Hi, i would really need to know how could a javascript method call another method written in a c# script at the same client ofcourse!! or if any one could help me in a highlighting function in javascript? your responces are highly appreciated.. Thanx:-D

    S R 2 Replies Last reply
    0
    • R r_jaz

      Hi, i would really need to know how could a javascript method call another method written in a c# script at the same client ofcourse!! or if any one could help me in a highlighting function in javascript? your responces are highly appreciated.. Thanx:-D

      S Offline
      S Offline
      SABhatti
      wrote on last edited by
      #2

      you cannot call a server function from client without postback. I don't what you want to do. to highlight a row you have to add onclick attribute to the row on rowdatabound and in that function (javascript) you can do row.style.backgroundColor = 'blue'

      -----

      1 Reply Last reply
      0
      • R r_jaz

        Hi, i would really need to know how could a javascript method call another method written in a c# script at the same client ofcourse!! or if any one could help me in a highlighting function in javascript? your responces are highly appreciated.. Thanx:-D

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

        To talk between the client and server, you'd have to psotback, or use AJAX.... There's no way to simply "call" a server side funciton from the client

        "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

        R 1 Reply Last reply
        0
        • R RichardGrimmer

          To talk between the client and server, you'd have to psotback, or use AJAX.... There's no way to simply "call" a server side funciton from the client

          "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

          R Offline
          R Offline
          r_jaz
          wrote on last edited by
          #4

          Thanks all for replies :) my question is if i can call a c# script method from the javascript on the client, NOT a server method.. its bcus i wrote my code in c# script and i found out that the java script is going to deal with it too, i don't know if there's some way but i could'nt found any yet!! thanks all again..

          R 1 Reply Last reply
          0
          • R r_jaz

            Thanks all for replies :) my question is if i can call a c# script method from the javascript on the client, NOT a server method.. its bcus i wrote my code in c# script and i found out that the java script is going to deal with it too, i don't know if there's some way but i could'nt found any yet!! thanks all again..

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

            Right then - think you're labouring under a misapprehension here - your c# code IS NOT RUNNING ON THE CLIENT - it's on the server - the fact that it's in the same page as the markup and the js is immeterial - look for the runat=server / <% %> indicators = both mean the code is ACTUALLY executing on the server.

            "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

            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