Sep 14, 2012, 5:55 AM
[CLOSED] Adding multiple Fields
Hi,
I have the problem, when I add multiple Fields/Labels in code behind I alway get the same error.
Server Error in '/' Application.
A Control with an ID of "False" has already been initialized. Please ensure that all Controls have a unique id.
The following Control has the same ID as at least one other Control on the Page. All Controls must have a unique ID.
What I'm doing wrong?
I have the problem, when I add multiple Fields/Labels in code behind I alway get the same error.
<%@ Page Language= "VB"%>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtmxl1/DTD/xht...ansitional.dtd">
<script runat="server">
Public ReadOnly Property Texts As List(Of String)
Get
Dim l As New List(Of String)
l.AddRange({"Elke", "Peter", "Dani"})
Return l
End Get
End Property
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim p As New Ext.Net.Panel
Session("Texts") = Texts
Dim l As Ext.Net.Label
Dim counter As Integer = 0
For Each t In Texts
l = New Ext.Net.Label
With l
.ID = "AjaxLab" = counter.ToString
.Cls = "editable"
.OverCls = "editable-over"
.Html = t
End With
Dim edit As New Ext.Net.Editor
With edit
.ID = "edit" + counter.ToString
.UpdateEl = False
End With
Dim par As New Ext.Net.Parameter
With par
.Name = "value" + counter.ToString
.Value = "value" + counter.ToString
.Mode = ParameterMode.Raw
End With
edit.DirectEvents.Complete.ExtraParams.Add(par)
par = New Ext.Net.Parameter
With par
.Name = "Index" + counter.ToString
.Value = counter.ToString
.Mode = ParameterMode.Value
End With
edit.DirectEvents.Complete.ExtraParams.Add(par)
AddHandler edit.DirectEvents.Complete.Event, AddressOf CompleteEdit
l.Editor.Add(edit)
Me.Form.Controls.Add(l)
Me.Tab3.Add(l)
counter = counter + 1
Next
Me.Tab3.Add(p)
End Sub
Public Sub CompleteEdit(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs)
'Me.AjaxLabel.Text = e.ExtraParams("value1").ToString
'Dim v = e.ExtraParams("mmmm").ToString
'If e.ExtraParams("value") IsNot Nothing Then
' Dim n = e.ExtraParams("value").ToString
'End If
'Dim vb = e.ExtraParams("mmmm").ToString
End Sub
</script>
>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Editor Overview - Ext.NET Examples</title>
<link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.editable {
font: 14px Tahoma;
padding: 3px 5px;
cursor: pointer;
margin-bottom: 20px;
}
.editable-over {
background-color: #ffc;
}
.x-form-field-editor {
font: 12px Tahoma;
}
</style>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Viewport ID="Viewport1" runat="server" Layout="fit">
<Items>
<ext:TabPanel ID="TabPanel1" runat="server" Border="false">
<Defaults>
<ext:Parameter Name="BodyStyle" Value="padding:10px;" Mode="Value" />
</Defaults>
<Items>
<ext:Panel ID="Tab3" runat="server" Title="Ajax Update">
<Items>
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:Viewport>
</form>
</body>
</html>
the error is:Server Error in '/' Application.
A Control with an ID of "False" has already been initialized. Please ensure that all Controls have a unique id.
The following Control has the same ID as at least one other Control on the Page. All Controls must have a unique ID.
What I'm doing wrong?
Last edited by Daniil; Sep 14, 2012 at 1:34 PM.
Reason: [CLOSED]