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. CascadingDropDown Using Page Method insted of webmethod

CascadingDropDown Using Page Method insted of webmethod

Scheduled Pinned Locked Moved ASP.NET
help
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.
  • M Offline
    M Offline
    Malayil alex
    wrote on last edited by
    #1

    Hi, I have a small problem with me in my project i am using ajaxtoolkit control CascadingDropDown but almost all examples the value is filled using webservice but insted of that i want to fill the values using some page method like usual functions......can anybody have experience about this..pls suggest me.. regards alex.

    D 1 Reply Last reply
    0
    • M Malayil alex

      Hi, I have a small problem with me in my project i am using ajaxtoolkit control CascadingDropDown but almost all examples the value is filled using webservice but insted of that i want to fill the values using some page method like usual functions......can anybody have experience about this..pls suggest me.. regards alex.

      D Offline
      D Offline
      Declan Bright
      wrote on last edited by
      #2

      Hi Malayil If you want to populate cascading dropdownlists using page methods there is no point using the ajax toolkit. The entire page must postback to execute page methods which goes against what ajax is all about.

      Declan Bright www.declanbright.com

      M 1 Reply Last reply
      0
      • D Declan Bright

        Hi Malayil If you want to populate cascading dropdownlists using page methods there is no point using the ajax toolkit. The entire page must postback to execute page methods which goes against what ajax is all about.

        Declan Bright www.declanbright.com

        M Offline
        M Offline
        Malayil alex
        wrote on last edited by
        #3

        hi.. thanks for ur reply...i found that if we want to page method insted of adding asmx file just keep the value of ServicePath as null in one site " http://www.asp.net/AJAX/AjaxControlToolkit/Samples/CascadingDropDown/CascadingDropDown.aspx" ServicePath - Path to a web service that returns the data used to populate the DropDownList. This property should be left null if ServiceMethod refers to a page method. The web service should be decorated with the System.Web.Script.Services.ScriptService attribute. that's why i asked abt this.... thanks alex.

        D 1 Reply Last reply
        0
        • M Malayil alex

          hi.. thanks for ur reply...i found that if we want to page method insted of adding asmx file just keep the value of ServicePath as null in one site " http://www.asp.net/AJAX/AjaxControlToolkit/Samples/CascadingDropDown/CascadingDropDown.aspx" ServicePath - Path to a web service that returns the data used to populate the DropDownList. This property should be left null if ServiceMethod refers to a page method. The web service should be decorated with the System.Web.Script.Services.ScriptService attribute. that's why i asked abt this.... thanks alex.

          D Offline
          D Offline
          Declan Bright
          wrote on last edited by
          #4

          Ok, I see what you mean now, I haven't tried it this way, it sure seems odd. I would definitely prefer to keep page and service methods separate. Anyway, it looks like if you add the these attributes to your page methods:

          [System.Web.Services.WebMethod]
          [System.Web.Script.Services.ScriptMethod]

          and leave the ServicePath blank that it should work. Your page methods must also return a CascadingDropDownNameValue[] collection.

          Declan Bright www.declanbright.com

          M 1 Reply Last reply
          0
          • D Declan Bright

            Ok, I see what you mean now, I haven't tried it this way, it sure seems odd. I would definitely prefer to keep page and service methods separate. Anyway, it looks like if you add the these attributes to your page methods:

            [System.Web.Services.WebMethod]
            [System.Web.Script.Services.ScriptMethod]

            and leave the ServicePath blank that it should work. Your page methods must also return a CascadingDropDownNameValue[] collection.

            Declan Bright www.declanbright.com

            M Offline
            M Offline
            Malayil alex
            wrote on last edited by
            #5

            Hi, I have a problem..like in my project i have 4 dropdownlsit and i extended the dropdownlist say 3 & 4 with CascadingDropDown..and it works fine.. but the problem is that when i select dropdownlist 1 then the control goes to the asmx method ie,what we mapped for dropdownlist 3...it's an unwanted code execution..... pls suggest me.. alex.

            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