You can do a Page.FindControl("CONTROL_ID");
note though that this isn't a recursive find (like client-side
getElementById()
for example, say the control you wanted was inside a placeholder:
<asp:placeholder id="plc" runat="server">
<asp:dropdownlist id="ddl" runat="server">
</asp:placeholder>
rather, you'll need to eitehr nest them:
Page.FindControl("plc").FindControl("ddl")
or base it off the parent control:
ddlontrol.FindControl("ddl")
of course, if the control isn't nested, you can just do
Page.FindControl("ControlId") and ignore everything I said except the first
line (Which is the same as this line!!)
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!
"Kamal Ahmed" <mh********@yahoo.com> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
Hi all,
I want to execute a String that is generated at Runtime and fills data in
DropDownList Controls at Runtime. I want to do this at server side. As
Eval functions works as client side function and there is not other
function or command to do this
example is here..
("ddlSub" & CStr(nRow) & ".DataSource = dtrSubject")
I want to evaluate this string to get name of control at runtime e.g.
ddlSub1, ddlSub2, ddlSub3 and so on
How it will be done using Asp.Net 1.1 using Vb.Net ?
TIA