G Guest Nov 17, 2006 #1 How can you find a control's type in ASP .NET (using C#, in Page_Load function) if you only know the control's name?
How can you find a control's type in ASP .NET (using C#, in Page_Load function) if you only know the control's name?
G Guest Nov 17, 2006 #2 Hey Joachim If I understand you correctly you want to know the type of a control given its name. Given the contril is called Button2, You could try this: string typeName = Page.FindControl("Button2").GetType().Name; This will return "Button" Hope that helps
Hey Joachim If I understand you correctly you want to know the type of a control given its name. Given the contril is called Button2, You could try this: string typeName = Page.FindControl("Button2").GetType().Name; This will return "Button" Hope that helps
G Guest Nov 17, 2006 #3 Perfect! Thanks! Rad said: Hey Joachim If I understand you correctly you want to know the type of a control given its name. Given the contril is called Button2, You could try this: string typeName = Page.FindControl("Button2").GetType().Name; This will return "Button" Hope that helps -- Bits. Bytes. http://bytes.thinkersroom.com Click to expand...
Perfect! Thanks! Rad said: Hey Joachim If I understand you correctly you want to know the type of a control given its name. Given the contril is called Button2, You could try this: string typeName = Page.FindControl("Button2").GetType().Name; This will return "Button" Hope that helps -- Bits. Bytes. http://bytes.thinkersroom.com Click to expand...