J
jc
The DDL is an ASP Dropdownlist inside a Sharepoint formwebpart. I
have a C# script code block where I'm just trying to populate a DDL..
but I can't seem to get to it. I'm using Sharepoint Designer and
somewhat of a C# noob so I'm struggling and taking baby steps.
<asp
ropDownList runat="server" id="FacilityDDL"
DataTextField="Title" DataValueField="Title" /></td>
If I try this
Page_OnLoad
FacilityDDL.Items.Add("x");
I get
Value does not fall within the expected range.
This comes back without errors, but does nothing.
DropDownList fddl = (DropDownList)this.Page.FindControl
("FacilityDDL");
fddl.Items.Add("x");
If I try it on Page_Prerender
I get Object reference not set to an instance of an object
How can I confirm fddl found it? I'm presuming I don't need to
databind.
thanks for any help or information!
have a C# script code block where I'm just trying to populate a DDL..
but I can't seem to get to it. I'm using Sharepoint Designer and
somewhat of a C# noob so I'm struggling and taking baby steps.
<asp
![Big Grin :D :D](/styles/default/custom/smilies/grin.gif)
DataTextField="Title" DataValueField="Title" /></td>
If I try this
Page_OnLoad
FacilityDDL.Items.Add("x");
I get
Value does not fall within the expected range.
This comes back without errors, but does nothing.
DropDownList fddl = (DropDownList)this.Page.FindControl
("FacilityDDL");
fddl.Items.Add("x");
If I try it on Page_Prerender
I get Object reference not set to an instance of an object
How can I confirm fddl found it? I'm presuming I don't need to
databind.
thanks for any help or information!