title: How to postback server by JavaScript Asp.net
body: <pre><code>namespace KetBanBonPhuong.Controls.Default
  {
       public partial class SugFriends : System.Web.UI.UserControl
      {
          private string Uid;
  
          protected void Page_Load(object sender, EventArgs e)
          {
              if (Request.Cookies["UId"] != null)
          {
              string value = Request.Cookies["UId"].Value;
              Uid = UserService.GetId_Cookie(value);
          }
          else
          {
              Uid = Session["Id"].ToString();
          }
          LoadListSuggest();
      }
  
      private void LoadListSuggest()
      {
          string str = "";
          List&lt;RankByUser&gt; list = new List&lt;RankByUser&gt;();
          list = RankByUserService.GetListRank(Uid);
          foreach (RankByUser rank in list)
          {
              str += "&lt;li&gt;&lt;div class=\"sug_acc\"&gt;"
                  + "&lt;a href=\"/" + rank.Link + ".aspx\"&gt;&lt;img src=\"" + rank.Avatar + "\" alt=\"avatar\"/&gt;&lt;/a&gt;"
                  + "&lt;a href=\"/" + rank.Link + ".aspx\" class=\"sug_name\"&gt;" + rank.LastName + " " + rank.FirstName + "&lt;/a&gt;"
                  + "&lt;/div&gt;"
                  + "&lt;div class=\"rank\"&gt;"
                  + "&lt;a href=\"#\" title=\"Xem chi tiết\" class=\"num\"&gt;rank: " + rank.Rank + "&lt;/a&gt;"
                  + "&lt;a href=\"#\" class=\"button mycoblue\"&gt;Kết bạn&lt;/a&gt;"
                  + "&lt;/div&gt;&lt;/li&gt;";
          }
              ltrListSug.Text = str;
          }
      }
  }`
  </code></pre>
  
  <p>It's a user control <code>SugFriends.ascx</code> being add in <code>Default.Master</code></p>
  
  <p>When I click <code>"a.button"</code> postback event to server?(I want to insert data to database, I used Sql server)</p>
  
  <p>How to do it? Make tag a event <code>onclick</code> 'like' <code>LinkButton: Onclick()</code>? </p>
  
  <p>Thanks for your helping! I found solution that problem! I used Ajax onclick for each tag a, event post Ajax.aspx, in here I can code work with database!</p>