You are currently browsing the tag archive for the 'Asp_net' tag.

http://www.dotnetspider.com/resources/23154-Adding-Javascript-Alert-for-Delete-button.aspx

Event of GridView

OnRowDataBound=”GridView1_RowDataBound”

Code behind:

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        //add  javascript alert for delete link button
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            LinkButton l = (LinkButton)e.Row.FindControl(“lbtnDeleteGrid”);
            l.Attributes.Add(“onclick”, “return confirm(‘Ban có muốn xóa ngày này không ?’)”);
        }

    }

grid.row[0].cells[0].text = Server.HTMLEncode(“<b>hlml encode :D </b>”);

http://www.codeproject.com/KB/session/Reconnect.aspx

<%@ OutputCache Location=”None” VaryByParam=”None” %>
<html>
</html>

html control:
input type=’text’ name=’text1′

code in .cs file :
if (Request.Form["text1"] is object)
item.Text = Request.Form["text1"].ToString();

In *.aspx insert control :
asp:Literal ID=”literal1″ runat=”server”

In *.aspx.cs insert code html wanted:
literal1.text = “hello“;

and more than ….

private void SortEntities(List _entities)
{
_entities.Sort(delegate(salary_processEntity x, salary_processEntity y)
{
return new employeesDAO().SelectOne(x.employee_code).employee_name.CompareTo(new employeesDAO().SelectOne(y.employee_code).employee_name);
});
}