Looping through forms on parent page from user control

D

Doug

I've got a user control (.ascx) which sets various properties on
controls on the parent. It works fine for a specified form.

I'm trying to make it a bit smarter, specifically for use on mobile
pages where there are multiple forms, by looping through all the forms
on the parent page.

I need something like: foreach(Form frm in Page.Controls) or similar,
but this just gives me "Specified cast is not valid".

2 questions:
1. Can someone help me out with the syntax here?
2. Is it ok to have user controls on mobile forms or is there some
"mobile alternative"?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top