Hi Guys, i hope someone can help me with my Problem.
It adding a bunch of RadComboBox dynamiclly on PageLoad to my Page. This works without Problems.
But if i want to find any Combobox by $find i always get Null back.
Has this something to do with kind of adding?
Here is my Code:
And my find function:
Thank you for reading :)
Daniel
It adding a bunch of RadComboBox dynamiclly on PageLoad to my Page. This works without Problems.
But if i want to find any Combobox by $find i always get Null back.
Has this something to do with kind of adding?
Here is my Code:
Public Sub MenuHrefAnlegen(ByVal endVal As Integer, ByVal strArrQuerystring As Array) Dim width As String = "width:199px;" Dim count As Integer = 1 Dim i As Integer Dim startval As Integer startval = 1 For i = startval To endVal 'erzeuge menü element Dim combo As New RadComboBox() combo.ID = "rcbHrefAuswaehlen" & count combo.EnableLoadOnDemand = True combo.Skin = "Metro" combo.Items.Insert(0, New RadComboBoxItem("Über uns", String.Empty)) combo.Items.Insert(1, New RadComboBoxItem("Baufinanzierung", String.Empty)) combo.Items.Insert(2, New RadComboBoxItem("Denkmal-Immobilien", String.Empty)) combo.Items.Insert(3, New RadComboBoxItem("Photovoltaik", String.Empty)) combo.Items.Insert(4, New RadComboBoxItem("Assekuranz", String.Empty)) combo.Items.Insert(5, New RadComboBoxItem("Kontaktseite", String.Empty)) combo.Items.Insert(6, New RadComboBoxItem("Impressum", String.Empty)) combo.Items.Insert(7, New RadComboBoxItem("Benutzerdefinierte Seite", String.Empty)) Dim hfMenuElement As New HiddenField hfMenuElement.ID = "hfMenuElement" + count.ToString() hfMenuElement.Value = strArrQuerystring(count) MenuAusMenuPunktenZusammengesetzt.Controls.Add(New LiteralControl("<li class=""floatKill""><a href=""#"" id=""hrefm" & count & """ runat=""server"" onmouseover=""menuov('menuleft" & count & "', 'menupuffer" & count & "', 'menuright" & count & "');"" onmouseout=""menuovf('menuleft" & count & "', 'menupuffer" & i & "', 'menuright" & count & "');""><div id=""menuleft" & count & """ class=""menu_left""></div><div id=""menupuffer" & count & """ class=""menu_puffer"" style=""" & width & """>" & strArrQuerystring(count) & "</div><div id=""menuright" & count & """ class=""menu_right""></div></a><div class=""pfeil links"" style=""margin-left:15px;margin-top:8px;""></div><div class=""pfeil links"" style=""margin-top:8px;""></div><div class=""pfeil links"" style=""margin-right:15px;margin-top:8px;""></div></li>")) MenuAusMenuPunktenZusammengesetzt.Controls.Add(combo) MenuAusMenuPunktenZusammengesetzt.Controls.Add(hfMenuElement) count += 1 NextEnd SubAnd my find function:
function CollectMenuElementeWithHref(sender, eventArgs) { var VID = $('input[id$=hfVermittlerID]').val(); var obj = { ID: VID }; for (var i = 1; i < 9; i++) { var hfVal = $('[id$=hfMenuElement' + i + ']').val(); //At this point i get Null back var combo = $find("<%= rcbHrefAuswaehlen" + i + ".ClientID %>"); var item = combo.get_items().getItem(2); if (hfVal) { obj["pa" + i] = hfVal obj["href" +1] = item.get_text() } } eventArgs.set_cancel(true); window.location.href = 'VermittlerBearbeiten.aspx?' + $.param(obj); }Thank you for reading :)
Daniel