PageMethod Not Updating - Requires Project Rebuild to be Updated
-
06-07-2019 - |
Question
I am using the AJAX Toolkit:
<ajaxToolkit:CascadingDropDown ID="CategoryDDL_C" runat="server" TargetControlID="CategoryDDL"
Category="Main" PromptText="Please select a category" LoadingText="[Loading...]"
ServiceMethod="MainDDL" />
And for the Service Method:
[WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static CascadingDropDownNameValue[] MainDDL(string knownCategoryValues, string category)
{
CascadingDropDownNameValue[] CDDNV = new CascadingDropDownNameValue[1] ;
CDDNV[0] = new CascadingDropDownNameValue(knownCategoryValues + "NO", "1");
return CDDNV;
}
However, if I make code changes in the MainDDL method, it is not reflected on the page until I do a Website Rebuild.
Any clues how I can update the Page Method without doing a full rebuild?
Solution
Web application projects need to be recompiled when codebehind files change, web site projects do not. Which is yours?
OTHER TIPS
Not sure if this is a bug of some sort, or some strange caching issue, but I've encountered the same thing in the past. This isn't amazingly convenient, but instead of rebuilding the site, try resaving your web.config file (you shouldn't have to actually change anything).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow