Here is the exception:
[NullReferenceException: Object reference not set to an instance of an object.]
Dynamicweb.eCommerce.Common.Context.get_LanguageID() +25
Dynamicweb.eCommerce.Products.Group.get_GroupByID(String groupID) +40
Dynamicweb.eCommerce.Products.Group.GetGroupsByIDs(IEnumerable`1 groupIDs) +93
Here is the code I use:
RenderAjaxSearch.ashx.cs:
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/html";
var productSearch = new UserControl().LoadControl("~/usercontrols/ProductSearch.ascx") as ProductSearch;
productSearch.Initialize();
}
Here is the initialize method:
public void Initialize()
{
var parentGroup = Group.GetGroupsByIDs(new List<string>
{
"SHOP2"
}).Cast<Group>().FirstOrDefault();
}
Developer forum
Loading control from generic handler
Replies
You must be logged in to post in the forum