title: issue with javascript in aspx file
body: <p>here is my code in aspx file...</p>
  
  <blockquote>
    
    
    <p>
    </p>
    
    <p>function updateuserstatus(arg) {
                //../images/approved.jpg" : "../images/rejected.jpg"</p>
  
  <pre><code>        var datauserid = $(arg).attr('data-userid');
          var curStatus = $(arg).attr('data-status');
          var upmstatus = (curStatus.toString().toLowerCase() == 'false' ? true : false);
  
          $.ajax({
              type: "POST",
              url: "Login.aspx/updatematerialstat",
              data: '{status: "' + upmstatus + '", id:"' + datauserid + '" }',
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function (msg) {
                  if (msg.d) {
  
                      var srcd = upmstatus ? "../admin/images/icn_alert_success.png" :
  </code></pre>
    
    <p>"../admin/images/icn_alert_error.png";
                            $("#img" + datauserid + "").attr("src", srcd);
                            $(arg).attr('data-status', upmstatus);
                        }
                    },
                    failure: function (response) {
                        alert(response.d);
                    }
                });
            }     </p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" BackColor="#CCCCCC" BorderColor="#999999"
      BorderWidth="3px" CellPadding="4" OnRowCancelingEdit="GridView1_RowCancelingEdit"
      OnRowDeleting="GridView1_RowDeleting" BorderStyle="Solid" OnRowCommand="GridView1_RowCommand"
      CellSpacing="2" ForeColor="Black" Height="100px" Width="602px" AutoGenerateColumns="False"
      AutoGenerateDeleteButton="True" 
      onselectedindexchanged="GridView1_SelectedIndexChanged"&gt;
      &lt;Columns&gt;
          &lt;%--&lt;asp:TemplateField HeaderText="IsActive"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:CheckBox ID="chkisactive" runat="server" Checked='&lt;%# Eval("Isactive") %&gt;' /&gt;
                  &amp;nbsp;
              &lt;/ItemTemplate&gt;
              &lt;HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /&gt;
              &lt;ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /&gt;
          &lt;/asp:TemplateField&gt;--%&gt;
          &lt;asp:TemplateField HeaderText="Edit"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:LinkButton ID="LinkButton1" runat="server" 
                      CommandArgument='&lt;%# Eval("ID") %&gt;' CommandName="Update"&gt;Update&lt;/asp:LinkButton&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
  
          &lt;asp:TemplateField HeaderText="FName"&gt;
              &lt;EditItemTemplate&gt;
                  &amp;nbsp;&lt;asp:Label ID="lbleditid" runat="server" Text='&lt;%# Eval("ID") %&gt;' Visible="False"&gt;&lt;/asp:Label&gt;
                  &lt;asp:Label ID="lblfname" runat="server" Text='&lt;%# Eval("Firstname") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/EditItemTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblfnameitem" runat="server" Text='&lt;%# Eval("Firstname") %&gt;'&gt;&lt;/asp:Label&gt;
                  &amp;nbsp;&lt;asp:Label ID="lbluserid" runat="server" Text='&lt;%# Eval("ID") %&gt;' Visible="False"&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
              &lt;HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /&gt;
              &lt;ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="LName"&gt;
              &lt;EditItemTemplate&gt;
                  &lt;asp:Label ID="lbllastname" runat="server" Text='&lt;%# Eval("Lastname") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/EditItemTemplate&gt;
              &lt;ItemTemplate&gt;
                  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
                  &lt;asp:Label ID="lbllnameitem" runat="server" Text='&lt;%# Eval("Lastname") %&gt;'&gt;&lt;/asp:Label&gt;
                  &amp;nbsp;
              &lt;/ItemTemplate&gt;
              &lt;HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /&gt;
              &lt;ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="Usertype"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblusertype" runat="server" Text='&lt;%# Eval("Usertype") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="Email"&gt;
              &lt;EditItemTemplate&gt;
                  &lt;asp:Label ID="lblemailid" runat="server" Text='&lt;%# Eval("EmailID") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/EditItemTemplate&gt;
              &lt;ItemTemplate&gt;
                  &amp;nbsp;&amp;nbsp;
                  &lt;asp:Label ID="lblemailitem" runat="server" Text='&lt;%# Eval("EmailID") %&gt;'&gt;&lt;/asp:Label&gt;
                  &amp;nbsp;
              &lt;/ItemTemplate&gt;
              &lt;HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /&gt;
              &lt;ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="City"&gt;
              &lt;EditItemTemplate&gt;
                  &lt;asp:Label ID="lblcity" runat="server" Text='&lt;%# Eval("City") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/EditItemTemplate&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblcityitem" runat="server" Text='&lt;%# Eval("City") %&gt;'&gt;&lt;/asp:Label&gt;
                  &amp;nbsp;
              &lt;/ItemTemplate&gt;
              &lt;HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /&gt;
              &lt;ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="State"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblstate" runat="server" Text='&lt;%# Eval("State") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="Address"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lbladdress" runat="server" Text='&lt;%# Eval("Address") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="Phone"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblphone" runat="server" Text='&lt;%# Eval("Phone") %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
           &lt;asp:TemplateField HeaderText="Approve"&gt;
             &lt;ItemTemplate&gt;
                      &lt;a href="javascript:;" data-status="&lt;%#Eval("Isactive") %&gt;" data-userid="&lt;%#Eval("ID") %&gt;"
                          onclick="updateuserstatus(this);"&gt;&amp;nbsp;
                          &lt;img id='img&lt;%#Eval("ID") %&gt;' src='&lt;%# Convert.ToBoolean(Eval("Isactive")) ?
  </code></pre>
    
    <p>"../admin/images/icn_alert_success.png" :
    "../admin/images/icn_alert_error.png" %>'
                                    height="20px" width="20px" />
                            
                        
                    
                    
                <br>
                
                    
                        
                    
                    
                    
                
                
                    
                        '>
                    
                
            
            
            
            
            
            
            
            
            
            
         </p>
  </blockquote>
  
  <p>and following is the webmethod...</p>
  
  <blockquote>
    <p>[WebMethod]
        public static bool updatematerialstat(bool status, int id)
        {
            bool res = false;
            try
            {
                user.Operation obj = new user.Operation();
                if (obj.ustatus(status, id))
                { res = true; }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return res;
        }</p>
  </blockquote>
  
  <p>now in browser it is giving following error...</p>
  
  <blockquote>
    <p>"ReferenceError: $ is not defined"</p>
  </blockquote>
  
  <p>any solution....???</p>