IF在标记中阻止更改数据源

时间:2013-12-09 02:22:42

标签: asp.net vb.net

我在test.aspx文件中有以下代码:

<% If (Session("username") <> "lok.dmt") Then%>
    <asp:dropdownlist id="id_loket"
        DataSource="<%# ModuleName.DefaultView %>"
        DataTextField="name_modul"
        DataValueField="id_modul"
        Width="385"
        runat="server"> </asp:dropdownlist>
<% Else%>             
    <asp:dropdownlist id="id_loket"
        DataSource="<%# ModuleNameDMT.DefaultView %>"
        DataTextField="name_modul"
        DataValueField="id_modul"
        Width="385"
        runat="server"> </asp:dropdownlist>           
<% End If%>   

当我运行该文件时,我收到以下错误;

Parser Error Message: The ID 'id_loket' is already used by another control.

0 个答案:

没有答案