TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dorababu Meka
226
8.3k
1.7m
List out all controls in a form
Nov 27 2013 8:44 AM
Hi all I am trying for a solution where I need to traverse through each and every from in my application and need to list out the controls which is not having associate control id for this I tried the following way first
Page p = BuildManager.CreateInstanceFromVirtualPath("/" + "test.aspx", typeof(Page)) as Page;
((IHttpHandler)p).ProcessRequest(HttpContext.Current);
ControlCollection lCollection = p.Controls;
Which is working a expected but the page which I am calling in that virtual path is getting added to the current page, how can I stop adding this.
The other one I tried is
string filePath = System.Web.HttpContext.Current.Request.PhysicalApplicationPath;
filePath = filePath + "test.aspx";
using (StreamReader sr = new StreamReader(filePath))
{
MessageBody = sr.ReadToEnd();
}
From the
MessageBody
I need to list out all the controls using some Regex, is this possible can some one help me to achieve my task
Reply
Answers (
0
)
regarding checkbox
previous button is not working correctly