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