Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Reply
List out all controls in a form
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Dorababu Meka
10y
969
1
Reply
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
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
regarding checkbox
previous button is not working correctly