Accessing WebUserControls and Webform properties
-
Hi all, I'm not sure if I'm heading in the right direction on this, if I'm making things over-complicated then please point it out and point me in the right direction! I'm writing a search filter for my website where people can refine their search results by adding/removing filters like on many other websites. Ebuyer.com springs to mind as a rough example of what I'm trying to achieve. I'm currently creating the filter list as a webusercontrol so that it can be added to more than one webform if required. I want it to interact with it's parent page by changing it's properties and running a couple of public methods (all on the parent page). How do I go about accessing the parent page properties etc? I have tried creating a reference to the page class in the webusercontrol, but it refuses to recognise it. I'm writing it in c#, does anyone have an example they could show me of how I should be doing it, I would greatly appreciate it, or at least a reference to a good comprehensive article, as so far what I have found has led me down dead ends. Any help would be appreciated. Thanks Mark
-
Hi all, I'm not sure if I'm heading in the right direction on this, if I'm making things over-complicated then please point it out and point me in the right direction! I'm writing a search filter for my website where people can refine their search results by adding/removing filters like on many other websites. Ebuyer.com springs to mind as a rough example of what I'm trying to achieve. I'm currently creating the filter list as a webusercontrol so that it can be added to more than one webform if required. I want it to interact with it's parent page by changing it's properties and running a couple of public methods (all on the parent page). How do I go about accessing the parent page properties etc? I have tried creating a reference to the page class in the webusercontrol, but it refuses to recognise it. I'm writing it in c#, does anyone have an example they could show me of how I should be doing it, I would greatly appreciate it, or at least a reference to a good comprehensive article, as so far what I have found has led me down dead ends. Any help would be appreciated. Thanks Mark
Sorry friend, Your post is too long and still i am not clear, According to me you want to make communication between User Control and Container Page, Right? Then you need to user Properties to Access Control from Page. And Events (You can pass any value as Event Argument, it can be a class) define in UserControl to communicate with the page. Hope this might be useful to you.
Best Regards, Chetan Patel