title: AjaxPro Framework hitting timeout function?
body: <p>I am trying to develop a chat application.I am using Asp.Net2.0 and vs2005.Iam using <a href="http://www.ajaxpro.info/" rel="nofollow">AjaxPro Framework</a> for getting <strong><code>asynchronous calls</code></strong> to the server side.</p>
  
  <p>My problem is when i send message im getting  <code>timeout</code> error after a few seconds.What could be the problem and how will i resolve it?</p>
  
  <p>My another doubt is that is there some serious problem in using  <strong><code>AjaxPro Framework</code></strong> </p>
  
  <p>Heres the code i have used in the client side to send messages</p>
  
  <pre><code>    &lt;script language="javascript"&gt;
             // Send messages
          function sendMessage()
          {               
              // input box for entering message
              var ta_content = el("txtcontent");
  
              // if the content input is not empty
              if (ta_content.value.length &gt; 0)
              {
                  //the message show area
                  var div_recentMsg = el("recentMsg");        
  
                  var clientUname=document.getElementById("&lt;%=hFieldClientUserName.ClientID %&gt;").value;       
  
                  var adminUname=document.getElementById("&lt;%=hFieldAdminUserName.ClientID %&gt;").value; 
  
                  // send the message
                  AjaxProChat.SendMessage(clientUname,adminUname,ta_content.value);
  
                  // clear the input box
                  ta_content.value = "";
  
                  // roll up the web page with the messages
                  ta_content.scrollIntoView(false);
  
                  getNewMessage();
  
  
              }
          }
  
  
          //Obtain the new messages
          function getNewMessage()
          {
              // AjaxProChat.timeouPeriod(1800000);
              // the user name
              var username = document.getElementById("&lt;%=hFieldClientUserName.ClientID %&gt;").value;        
  
              // the message show area
              var div_recentMsg = el("recentMsg");
  
              // Obtain the DataTable for the newest messages
              var dt = AjaxProChat.GetNewMsg(username).value;
              for (var i = 0;i &lt; dt.Rows.length;i++)
              {
  
                  // one message in response to one &lt;span&gt; object
                  var oneMsg = document.createElement("span");
  
                  // the message sender and corresponding sent content
                  var strLine1 = dt.Rows[i].Sender + " says: (" + dt.Rows[i].SendTime + ")";
                  strLine1 = DealBrackets(strLine1);
  
                  // the content of the message
                  var strLine2 = dt.Rows[i].Contents;
                  strLine2 = DealBrackets(strLine2);
  
                  // show style
                  oneMsg.innerHTML = "&lt;pre&gt;" + strLine1 + "&lt;br&gt;&amp;nbsp;&amp;nbsp;" + strLine2 + "&lt;/pre&gt;";
                  oneMsg.style.padding = "2px 2px 2px 2px";
                  oneMsg.style.color = (dt.Rows[i].Sender == username) ? "blue" : "red";
                  oneMsg.style.fontFamily = "'Courier New'";
  
                  // attached to DOM
                  div_recentMsg.appendChild(oneMsg);
              }
          }
  
  
  &lt;/script&gt;   
  </code></pre>
  
  <p>Heres the html code</p>
  
  <pre><code> &lt;div style="text-align: center"&gt;
      &lt;strong&gt;&lt;span style="font-size: 24pt"&gt;&lt;span style="color: #333399; background-color: #ffffff"&gt;
          Chatting Room&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;  
  
  &lt;/div&gt;
      &lt;table border="2" style="width: 792px; height: 443px;background-color:#ffffff;"&gt;
          &lt;tr&gt;
              &lt;td colspan="3" style="height: 373px; width: 729px;"&gt;
                  &lt;div id="recentMsg" style="width: 779px; height: 368px; overflow:auto;"&gt;
                  &lt;/div&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td colspan="3" style="height: 30px; width: 729px;"&gt;
                  &lt;asp:Label ID="Label1" runat="server" Font-Size="X-Large" ForeColor="Maroon"&gt;Input the message and click Send or press ENTER key:&lt;/asp:Label&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td colspan="3" style="height: 40px; width: 729px;"&gt;
                  &lt;input id="txtcontent" onkeydown="if (event.keyCode==13) {sendMessage();return false;}"
                      style="width: 55%; height: 30px" type="text" runat="server" /&gt;         
                  &lt;input onclick="javascript:sendMessage();" style="width: 58px; border-top-style: groove;
                      border-right-style: groove; border-left-style: groove; background-color: #ebf1fa;
                      border-bottom-style: groove; height: 34px;" type="button" value="Send" id="btnSend" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td colspan="3" style="width: 729px"&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>Heres the code for sending and receving messages i have written in server side</p>
  
  <pre><code>    [AjaxPro.AjaxMethod]//code for sending messages
  public void SendMessage(string Sender,string Receiver,string Content)
  {
      ChatBAL clsChat = new ChatBAL();
      clsChat.SENDER = Sender;
      clsChat.RECEIVER = Receiver;
      clsChat.CONTENT = Content;
      clsChat.SendMessage();
  
  }
  
  [AjaxPro.AjaxMethod]//code for getting latest message and returns datatable
  public DataTable GetNewMsg(string UserName)
  {
      ChatBAL clsChat = new ChatBAL();
      DataTable dtNewMsg =new DataTable();
      try
      {
          clsChat.USERNAME = UserName;
          dtNewMsg = clsChat.GetNewMessage();            
      }
      catch
      {
          throw;
      }
      finally
      {
          clsChat = null;
      }
      return dtNewMsg;
  }
  </code></pre>