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. hw to call server side function from client side

hw to call server side function from client side

Scheduled Pinned Locked Moved ASP.NET
sysadminlearning
3 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.
  • L Offline
    L Offline
    Learning IT
    wrote on last edited by
    #1

    i am trying to call server side function like this OnClientClick="'<%= checkcategory() %>'" OnClick="btn_submit_Click1" Text="Submit" /> it was not working can u provide me the solution thanks in advance

    learning developer

    S J 2 Replies Last reply
    0
    • L Learning IT

      i am trying to call server side function like this OnClientClick="'<%= checkcategory() %>'" OnClick="btn_submit_Click1" Text="Submit" /> it was not working can u provide me the solution thanks in advance

      learning developer

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

      Hi, the server-function that will be called is "btn_submit_Click1". So you don't need the OnClientClick. Regards Sebastian P.S.: Oh wait, you could also try to use AJAX, but that's more sophisticated. What do you want to achieve?

      1 Reply Last reply
      0
      • L Learning IT

        i am trying to call server side function like this OnClientClick="'<%= checkcategory() %>'" OnClick="btn_submit_Click1" Text="Submit" /> it was not working can u provide me the solution thanks in advance

        learning developer

        J Offline
        J Offline
        James Simpson
        wrote on last edited by
        #3

        The server event will be attached to btn_submit_Click1 Im assuming your hoping checkcategory() would be called from OnClientClick. OnClientClick is reserved for JavaScript which has no direct relationship with the server. You would need to call checkcategory (assuming its a server side function) in btn_submit_click1. Or if you explicitly needed to call checkcategory from the client side function you would use Ajax (Google it!) FYI, calling a javascript function from OnClientClick would be OnClientClick="checkCategory()" function checkCategory() { alert("CheckCategory Called.."); }

        James Simpson Web Developer imebgo@hotmail.com P S - This is what part of the alphabet would look like if Q and R were eliminated
        Mitch Hedberg

        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