AjaxMethod and and textfields

  1. #1

    AjaxMethod and and textfields

    Hi,

    I'm having some problem with my application. I got some code from dynamicdrive.com, which opens a Javascript window on the page. The reason why I'm not using an <ext:Window here is because I wan't to be able to style it the way I want. The dynamicdrive code can be found here:

    http://www.dynamicdrive.com/dynamici...ndow/index.htm

    In my repeater, I have a link that calls for the javascript function ShowWindow():

    <asp:Repeater ID="RepeaterLabelsAndText" runat="server">
           <ItemTemplate>
    <a href="#" &#111;nclick="ShowWindow('<%# DataBinder.Eval(Container.DataItem, "ID") %>')"><img src="images/livescribe_pen.png" alt="" /></a>
            </ItemTemplate>
        </asp:Repeater>
    In that javascript function, I'm calling an AjaxMethod in codebehind, and the script that opens the window from dynamicdrive:

    <script type="text/javascript" language="javascript">
       function ShowWindow(obj)
       {
           Coolite.AjaxMethods.EditLabel(obj);
           var googlewin=divwin=dhtmlwindow.open('divbox', 'div', 'somediv', '', 'width=450px,height=450px,left=200px,top=150px,resize=1,scrolling=1');      
       }
       </script>
    Here is the codebehind:

    [AjaxMethod]
       public void EditLabel(string Id)
       {
           LabelItem item = LabelItems.GetLabelItem(int.Parse(Id));
           if (item != null)
           {
               txtLabelId.Text = item.ID.ToString();
               txtLabelName.Text = "test";
               txtLabelText.Text = item.LabelText;
               txtLabelDesc.Text = item.LabelDesc;
               TextBox1.Text = "tester";
           }
       }
    And the div thats being opened by the

    <div id="somediv" style="display:none">
           <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
       <ext:TextField ID="txtLabelId" runat="server" Visible="false"></ext:TextField>
           Name<br />
           <ext:TextField ID="txtLabelName" runat="server"></ext:TextField><br /><br />
           Text<br />
           <ext:HtmlEditor id="txtLabelText" EnableAlignments="false" EnableSourceEdit="false" runat="server" Height="160" FieldLabel="Text" Width="450" /><br /><br />
           Description<br />
           <ext:TextField ID="txtLabelDesc" runat="server"></ext:TextField>
    When I put a break point in the AjaxMethod, I see that the function is being "hit", and I'm getting the right results, and its being inserted in the different textboxes. The window also opens up nice. But the problem is that the textboxes remain empty? Does anybody know what I am doing wrong? Is there something I should rethink?

    I appreciate any help!
  2. #2

    RE: AjaxMethod and and textfields

    Hi,

    We can't update none Coolite controls during AjaxEvent. Use UpdatePanel for that

Similar Threads

  1. Replies: 2
    Last Post: Jan 08, 2010, 2:47 AM
  2. [CLOSED] 100% width on combobox, textfields, etc
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 20, 2009, 11:51 AM
  3. MessageBox With 2 prompts/textfields?
    By Tbaseflug in forum 1.x Help
    Replies: 2
    Last Post: Jun 10, 2009, 10:22 AM
  4. html tags in textfields
    By [WP]joju in forum 1.x Help
    Replies: 0
    Last Post: Apr 16, 2009, 9:46 AM
  5. Adding textfields to tabs
    By sz_146 in forum 1.x Help
    Replies: 0
    Last Post: Nov 13, 2008, 10:35 AM

Posting Permissions