title: Need to use Focus in asp .net text box
body: <p>in on blur() event i have used jquery for validation . If validation occurs the text box color should change and the cursor should be on the same text box .  I have used focus() for this , but it is not working. Can you help me on this ?</p>
  
  <pre><code>HTML CODE :
  
  &lt;asp:TextBox ID="txtMemoName" runat="server" Width="200px" onblur="alertevent();" &gt;&lt;/asp:TextBox&gt;
  
  
  
  JQUERY :
  function alertevent() {
          var value = $("#&lt;%=txtMemoName.ClientID %&gt;").val();
          if (value == "") {
       $("#&lt;%=txtMemoName.ClientID %&gt;").focus();
       $("#&lt;%=txtMemoName.ClientID %&gt;").css('border', '1px solid red');
      }
  }
  </code></pre>