ClientIDMode=Static

  1. #1

    ClientIDMode=Static

    <ext:FileUploadField ID="uplUploader" IDMode="Static" runat="server"  FieldLabel="File" Icon="BulletPlus" ButtonText="Choose a file" />
    <ext:TextField ID="txtDescription" runat="server" FieldLabel="Description" IDMode="Static" />
    
    <!-- -some code   ------>
    
    <ext:Button ID="btnUpload" runat="server" Text="Загрузить">
        <DirectEvents>
              <Click OnEvent="UploadFile" After="txtDescription.clear(); uplUploader.clear();"></Click>
        </DirectEvents>
     </ext:Button>
    I can't set IDMode="Static" for each ext net control, because it thows an eror if a page contains controls with the same id.
    The code bellow doesn't work.

    <ext:FileUploadField ID="uplUploader" runat="server"  FieldLabel="File" Icon="BulletPlus" ButtonText="Choose a file" />
    <ext:TextField ID="txtDescription" runat="server" FieldLabel="Description" />
    
    <!-- -some code   ------>
    
    <ext:Button ID="btnUpload" runat="server" Text="Загрузить">
        <DirectEvents>
              <Click OnEvent="UploadFile" After="<%=txtDescription.ClientID%>.clear(); <%=uplUploader.ClientID%>.clear();"></Click>
        </DirectEvents>
     </ext:Button>
    How can I avoid using IDMode="Static" ?
  2. #2
    Does this problem have a solution?
  3. #3
    Quote Originally Posted by AlexMaslakov View Post
    I can't set IDMode="Static" for each ext net control, because it thows an eror if a page contains controls with the same id.
    The code bellow doesn't work.
    Correct. If IDMode="Static", than all Controls on the Page must have a unique ID. This must be managed by the developer.

    If two Controls have the same ID on the same Page, an Exception will be thrown.

    This is the desired functionality.
    Geoffrey McGill
    Founder
  4. #4
    If it's so, what's futher up? Does my problem have a solution?
  5. #5
    Unfortunately, you did not describe your problem
    Please provide more details
  6. #6
    Why does the code bellow doesn't work?

    The result html contains <%=txtDescription.ClientID%> and <%=uplUploader.ClientID%>, but not something like ctl00$ctl00$BaseMainContent$MainContent$txtDescrip tion

    <ext:FileUploadField ID="uplUploader" runat="server"  FieldLabel="File" Icon="BulletPlus" ButtonText="Choose a file" /> 
    <ext:TextField ID="txtDescription" runat="server" FieldLabel="Description" /> 
      
    <!-- -some code   ------>
      
    <ext:Button ID="btnUpload" runat="server" Text="Загрузить"> 
        <DirectEvents> 
              <Click OnEvent="UploadFile" After="<%=txtDescription.ClientID%>.clear(); <%=uplUploader.ClientID%>.clear();"></Click> 
        </DirectEvents> 
     </ext:Button>
  7. #7
    ASP.NET doesn't allow to mix <%%> blocks with text within one property
  8. #8
    What should I do?
  9. #9
    Set property in the code-behind
  10. #10
    Also you can use Ext.Net syntax
    After="#{txtDescription}.clear(); #{uplUploader}.clear();"

Similar Threads

  1. GridPanel bugs (with static example)
    By Z in forum 1.x Help
    Replies: 3
    Last Post: Feb 21, 2012, 3:20 PM
  2. Static List
    By pc.cotemig in forum 1.x Help
    Replies: 0
    Last Post: May 31, 2011, 2:15 PM
  3. Replies: 13
    Last Post: May 16, 2011, 1:26 PM
  4. [CLOSED] Static DirectMethod
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 21
    Last Post: Jun 03, 2010, 12:42 AM
  5. static ajaxmethod
    By [WP]joju in forum 1.x Help
    Replies: 2
    Last Post: Mar 04, 2009, 9:47 AM

Posting Permissions