Finding list of controls from another aspx page within a project
-
Asalaam Alakum, I am finding list of controls from another aspx page within a project, for this purpose i am tring reflection. If reflection is appropriate solution please give me code else tell me another solution. Thanks alot
Regards Syed Kamran ul Haq ALLAH HAFIZ
-
Asalaam Alakum, I am finding list of controls from another aspx page within a project, for this purpose i am tring reflection. If reflection is appropriate solution please give me code else tell me another solution. Thanks alot
Regards Syed Kamran ul Haq ALLAH HAFIZ
There's not really any way for one page to examine another page, because the only page that exists in your project at runtime is the page currently being generated. What do you need this for ?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
There's not really any way for one page to examine another page, because the only page that exists in your project at runtime is the page currently being generated. What do you need this for ?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
IF your using user controls it isn't an issue simply expose the user control and the controls on that page you wish to access via public properties
A pessimist sees the difficulty in every opportunity; an optimist sees the opportunity in every difficulty I am a Optimist
-
IF your using user controls it isn't an issue simply expose the user control and the controls on that page you wish to access via public properties
A pessimist sees the difficulty in every opportunity; an optimist sees the opportunity in every difficulty I am a Optimist
I would assume if he wants to enumerate controls on a page, he's actually hoping for their state to be maintained, and to get their previous values.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I would assume if he wants to enumerate controls on a page, he's actually hoping for their state to be maintained, and to get their previous values.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
just like we give form level security to users in our application, i am developing a form which will get the list of controls of a aspx page (page will be selected from ddl) and give rights (visible,enable etc) to them and save in database. thanks for answering.
Regards Syed Kamran ul Haq ALLAH HAFIZ
-
just like we give form level security to users in our application, i am developing a form which will get the list of controls of a aspx page (page will be selected from ddl) and give rights (visible,enable etc) to them and save in database. thanks for answering.
Regards Syed Kamran ul Haq ALLAH HAFIZ
OK, then string mashing is probably your best bet, just look for asp: and an ID attribute to get the type and name of controls.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )