I have created Custom User control which i am using in my application Page(which is deployed at _layouts folder).

Here is my scenario.

I have a save button in my custom user control, when i click on that control i would like to execute a method in .aspx(which is layout page). How can i acheive this ? Any ideas ?

Thanks in advance.

  • I am having the same problem. This works perfiectly in asp.net. But when i use the same thing in sharepoint, whenever i try to access public properties of user controls in sharepoint , it does not give me intellisense and then gives me build error if i just type the property.. any body help pls. – user9190 Jun 29 '12 at 7:43

This is really not a SharePoint question but here you can find an answer:

Calling a method in parent page from user control

I never actually done this but by looking at code there is nothing special and it should work on SharePoint. Of course instead of System.Web.UI.Page you are using Microsoft.SharePoint.WebControls.LayoutsPageBase

| improve this answer | |
  • 1
    Yes you are right, this is not a sharepoint question, but i am facing this issue in sharepoint. Well, i have used this in .net website, it was working. I declared event, delegate in user control, and registered the usercontrol in application page, but i am not able to get the event in application page codebehind (for ex: usercontrol.event). I am not able to see any property in application page code behind. I dont know whats wrong . – Share Sep 29 '11 at 3:13
  • only difference is you might have to manually register the delegate method to the click method of the button, in OnLoad. EDIT: Just noticed that the link there includes that. – James Love Oct 28 '11 at 22:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.