I have an ASCX inside an ASPX.
I want this ASCX to work with Atlas Scripting, for example doing this:
PageMethods.HelloWorld(OnWebRequestComplete1);
The problem is that it only works if HelloWorld is in the .ASPX.CS, but I want this method to be in the ASCX.CS.
If I put the HelloWorld inside the ASCX.CS a javascript error is thrown (it doesn't recognize what PageMethods is).
Any one has an idea??Hi,
at the moment you can't call a WebMethod inside a user control. You have to expose it in the Page class.
Thanks Garbin... that's a bad new
I would have to use AJAXPRO for this purpuse
I'm not sure that's entirely correct. I am doing just that, without any problem. The key is that you have to have the ScriptManager in the ASCX control, and then it works just fine. I assume, therefore, that you just can't have another in the Page itself. Otherwise, it works for me...
Hi,
thanks for pointing that out, lonevvolf. I wasn't thinking of this scenario because I see the ScriptManager tied to the Page rather than to an user control (where I would use the ScriptManagerProxy). However, if it works around the issue, it's good news.
Here's the way I'm doing it.
In the .ASPX page, I'm exposing a Web Method that will actually route the call to the user control's web method. This is the way I found that works best for me.
Is it possible that I can see your code, or share mine with you. I am unsuccessfull so far and need help. The whole idea behind this for me is to keep the .ascx control's code to be abstract from the user (developer. I want the user to be able to implement these controls very easily.
Thanks,
Jack
jfobel@.msn.com
I am sorry, my post was meant to be directed tolonevvolf. He states he has done this successfully.
Were you successful at it now? I'm having this same problem as I just discover it.
I'm unable to post the code here as I don't know how to get this forum to render this sample html script instead of malformation text...
No comments:
Post a Comment