I have got a page say ?a.aspx?, within which I want display all the controls present in any another ?aspx? page in a tree-view format. Supposing there are three pages other than ?a.aspx? in the project say ?b.aspx?,?c.aspx? & ?d.aspx?. Now, the user will be given an option to select any of these pages from a ?dropdownlist?. On selection, the controls of the selected page should be shown in a tree view.
To achieve this, I used 'Response.Redirect' method to redirect to the page selected by user say ?b.aspx?. In the 'Application_PreRequestHandlerExecute' event of the ?Global.asax? file which fires just before the 'OnInit' method of the page, using reflection I got the class of ?b.aspx? page. I tried creating an instance of the class and then tried to invoke the ?OnInit? method of the instance. But firstly, the ?OnInit? method is in ?Page? Class. But the ?OnInit? method being an internal method, could be accessed through reflection, it seems. There ...
Go to the complete details ...