[CLOSED] Adding multiple Fields

  1. #1

    [CLOSED] Adding multiple Fields

    Hi,

    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]
  2. #2
    Hi,

    Seems here was the same request.
    http://forums.ext.net/showthread.php?20921
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Seems here was the same request.
    http://forums.ext.net/showthread.php?20921
    Yes it is the same Request, normaly I get a Email from the Forum. Therefor i didn't see it.
    Thank you.
  4. #4
    Ok, thank you for clarification.

    If there will be any problems with the notifications again, please report.

Similar Threads

  1. [CLOSED] Adding Tag Property to all fields
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Nov 14, 2011, 5:52 PM
  2. Replies: 7
    Last Post: Mar 09, 2011, 8:15 PM
  3. How to sorted by multiple fields?
    By bruce in forum 1.x Help
    Replies: 0
    Last Post: May 04, 2009, 4:10 AM
  4. Adding Form fields at run time
    By sz_146 in forum 1.x Help
    Replies: 1
    Last Post: Feb 10, 2009, 6:18 PM
  5. Dynamically adding form fields
    By sz_146 in forum 1.x Help
    Replies: 4
    Last Post: Nov 11, 2008, 11:10 AM

Posting Permissions