Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
QuestionFindControl on Fields on an aspx screen. Pin
imnotso#19-Nov-07 4:33
imnotso#19-Nov-07 4:33 
AnswerRe: FindControl on Fields on an aspx screen. Pin
Anthony Mushrow19-Nov-07 4:42
professionalAnthony Mushrow19-Nov-07 4:42 
GeneralRe: FindControl on Fields on an aspx screen. Pin
imnotso#19-Nov-07 4:58
imnotso#19-Nov-07 4:58 
AnswerRe: FindControl on Fields on an aspx screen. Pin
martin_hughes19-Nov-07 5:27
martin_hughes19-Nov-07 5:27 
GeneralRe: FindControl on Fields on an aspx screen. Pin
imnotso#19-Nov-07 5:36
imnotso#19-Nov-07 5:36 
GeneralRe: FindControl on Fields on an aspx screen. Pin
Anthony Mushrow19-Nov-07 5:42
professionalAnthony Mushrow19-Nov-07 5:42 
GeneralRe: FindControl on Fields on an aspx screen. Pin
imnotso#19-Nov-07 5:55
imnotso#19-Nov-07 5:55 
GeneralRe: FindControl on Fields on an aspx screen. Pin
Anthony Mushrow19-Nov-07 6:08
professionalAnthony Mushrow19-Nov-07 6:08 
Oops, made a slight error it should be:

foreach(Control d in c.Controls) {<br />
...


And it then should of course be:

if(d is textbox)
...
not if(c is textbox) Roll eyes | :rolleyes:

C#
foreach(Control c in Page.FindControl("MyPage").Controls) {
    if(c is TextBox)
        c.Text = "";
    if(c is Panel)
        foreach(Control d in c.Controls) {
            if(d is TextBox)
                d.Text = "";
        }
}





My current favourite word is: PIE!

Good ol' pie, it's been a while.

GeneralRe: FindControl on Fields on an aspx screen. Pin
imnotso#19-Nov-07 6:13
imnotso#19-Nov-07 6:13 
QuestionBreak out of a loop Pin
Programm3r19-Nov-07 4:16
Programm3r19-Nov-07 4:16 
AnswerRe: Break out of a loop Pin
led mike19-Nov-07 4:34
led mike19-Nov-07 4:34 
GeneralRe: Break out of a loop Pin
Programm3r19-Nov-07 4:36
Programm3r19-Nov-07 4:36 
GeneralRe: Break out of a loop Pin
led mike19-Nov-07 4:55
led mike19-Nov-07 4:55 
AnswerRe: Break out of a loop Pin
J4amieC19-Nov-07 4:34
J4amieC19-Nov-07 4:34 
AnswerRe: Break out of a loop Pin
Shpendh19-Nov-07 5:31
Shpendh19-Nov-07 5:31 
GeneralRe: Break out of a loop Pin
Colin Angus Mackay19-Nov-07 6:04
Colin Angus Mackay19-Nov-07 6:04 
GeneralRe: Break out of a loop Pin
J4amieC19-Nov-07 6:20
J4amieC19-Nov-07 6:20 
GeneralRe: Break out of a loop Pin
Mark Churchill19-Nov-07 14:33
Mark Churchill19-Nov-07 14:33 
JokeRe: Break out of a loop Pin
Pete O'Hanlon19-Nov-07 10:29
mvePete O'Hanlon19-Nov-07 10:29 
GeneralRe: Break out of a loop Pin
PIEBALDconsult19-Nov-07 13:43
mvePIEBALDconsult19-Nov-07 13:43 
GeneralRe: Break out of a loop Pin
Colin Angus Mackay19-Nov-07 13:52
Colin Angus Mackay19-Nov-07 13:52 
GeneralRe: Break out of a loop Pin
Shpendh19-Nov-07 20:57
Shpendh19-Nov-07 20:57 
AnswerRe: Break out of a loop Pin
Alan N20-Nov-07 8:01
Alan N20-Nov-07 8:01 
Question.NET Framework 3 (WCF) Service with .NET Framework 1.1 / 2 Client Pin
GChannon19-Nov-07 4:15
GChannon19-Nov-07 4:15 
AnswerRe: .NET Framework 3 (WCF) Service with .NET Framework 1.1 / 2 Client Pin
Pete O'Hanlon19-Nov-07 10:40
mvePete O'Hanlon19-Nov-07 10:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.