Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
MyPageInformationPage.aspx probably inherits from TemplatePage<MyPagePersonalInformation>, and because you don't specify a "correct" pageid, PTB tries to cast the page to a faulty pagetype.
I would put the UploadFile in a seperate webservice/page or just specify a pageid in the AJAX-request.
Hej and thanks for your reply!
Eventually I implemented another solution, but it sounds like your idea would have worked as well, i just didn't come up with it. Something to take into account in the future. Thanks!
/Kenia
Hello everybody,
I have a website in CMS 6 that uses PageTypeBuilder. Everything works fine except that in one of the page templates i need to make an ajax request, and after declaring a [webmethod] on server side when i try to call it from javascript then i get the following PTB error
"The current page is not of type MyPagePersonalInformation. This often occurs when no id
query string parameter is specified".
The ajax call as well as the method on server side are very simple for testing purposes.
$("#fileUpload").change(function () {
$.ajax({
type: "POST",
url: "/Templates/BW/Pages/MyPageInformationPage.aspx/UploadFile",
success: function (msg) {
alert(msg);
}
})
});
[WebMethod]
public static string UploadFile()
{
return "uploaded";
}
Any ideas of what the problem could be?
Thanks in advance,
/Kenia