Popular Posts
ListSelectionListener & ItemListener import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Toolkit; import java.awt.event.ItemEvent; import java.awt.event.ItemL... netbean shortcut Ctrl + F:尋找 F3:尋找下一個字串 Ctrl + G:跳到第 N 行 Ctrl + H:取代 Tab:增加縮排 Shift + Tab:減少縮排 Ctrl + E:刪除一行 Ctrl + Shift + I:修正 import 項目 Alt + Ent... Capture response output stream using HttpModule using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Web; namespace TestWebA...
Blog Archive
Stats
UpdatePanel in Formview occurs duplicate component id error
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InnerUpdatePanel.aspx.cs"
    Inherits="superspace.control.info.InnerUpdatePanel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:FormView ID="fvVote" runat="server" DefaultMode="Insert">
            <InsertItemTemplate>
                <asp:TextBox ID="txtVoteName" runat="server" />
                <asp:UpdatePanel ID="upOption" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <table border="0" width="100%">
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtOption" runat="server" />
                                </td>
                                <td>
                                    <asp:Button ID="btnAddOption" runat="server" Text="新增選項" />
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </InsertItemTemplate>
            <EditItemTemplate>
                <asp:TextBox ID="txtVoteName" runat="server" />
                <asp:UpdatePanel ID="upOption" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <table border="0" width="100%">
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtOption" runat="server" />
                                </td>
                                <td>
                                    <asp:Button ID="btnAddOption" runat="server" Text="新增選項" />
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </EditItemTemplate>
        </asp:FormView>
    </div>
    </form>
</body>
</html>
Solutions:
  1. Remove update panel
  2. Create a user control wrapping update panel