0

Hello it is possible to load an user control or an asp.net page inside another asp.net page with an ajax call?. What i want to do is to show a login box so i need to access also the code beynd of the control from the calling page, i know it is possible server side, but how to do it with javascript ajax?

I can call a server side method from javascript ajax that return the html of a page/user control but how can i return the server side logic of the returned html page, in order to make it available from the calling page?

John Dvorak
  • 26,799
  • 13
  • 69
  • 83
sparrows81
  • 431
  • 3
  • 6
  • 19

1 Answers1

0

No unfortunately you wont be able to access the server side controls you have made for the page you are loading in via Ajax.

Stuff you load in via Ajax has to be controlled on the client side.

Kimtho6
  • 6,154
  • 9
  • 40
  • 56
  • i think it must be a way to do it: with ajax i can load an user control infact i can call a web method that add the required user control to the page object, then i can return from the same ajax call the html of the control but i don't know how to link the parsed html with the included code behid of user control. Now i have the login button the login_button_click event server side but i can't link the 2 things – sparrows81 May 22 '13 at 13:05
  • You can create a web service to controll stuff you want to load via ajax – Kimtho6 May 22 '13 at 13:06
  • Ow you can of course do it if you loade the content into an iframe but thats not a pretty way of doing it – Kimtho6 May 22 '13 at 13:08