Skip to main content

Posts

check all checkboxes under table or gridview

 <table width="100%" border="0" cellpadding="3" cellspacing="0" class="block-borders">                             <tr>                                 <td width="100%" colspan="2">                                     <asp:DataList ID="dListRolesList" ItemStyle-Width="17%" RepeatColumns="3"                                         RepeatDirection="Horizontal" runat="server" DataKeyField="Id" Width="95%">                                         <ItemTemplate>                   ...

denr_rank over partition to skip null value

select distinct *,(CASE WHEN seq is not null  THEN DENSE_RANK() OVER (PARTITION BY menuid , (case when seq is not null  then 1 else 0 end) ORDER BY  SubMenuId)-1  ELSE null END) as   index1 From #SubMenu    order by MenuID asc,isDisplay  desc

Dynamic Menu in asp.net using Listview

 1.    public DataTable LoadMenu()         {             MenuBal MenuBal = new MenuBal();             DataSet ds = this.GetData(0);             PopulateMenu(ds);             return ds.Tables[2];         }     private DataSet GetData(int parentMenuId)         {             MenuBal objmenu = new MenuBal();             string Mode = "";             if (Session["Mode"] != null)             {                 Mode = Session["Mode"].ToString();             }             DataSet ds = objmenu.GetData(parentMenuId, Convert.ToInt32(SessionHelper.CurrentUserId), Mode, SessionHelper...

fetchresourec file data in javascrip t

var lang = '<%=Session["Lang"].ToString()%>';  resource file name = Langpt_PT   if (lang=="pt-PT")                                            errMsg += "\n <%=Resources.Langpt_PT.PleaseselectGenderForRow%>" + id;                                            else                                           errMsg += "\n Please select Gender For Row " + id;

Load View With Dynamic Height and width

rowCount is total number of rows          .aspx function LoadView(rowscount) {             var tempHeight = 100;             var tempWidth = 100;             var tempLength = 100;             var tempTop = 100;             var tempLeft = 100;             if (rowscount == 1) {                 tempHeight = 370;                 tempWidth = 250;                 tempTop = 190;                 tempLeft = 500;             }             else if (rowscount == 2) {                 tempHeight = 370;             ...

Add barcode on pdf

using System; using System.IO; using System.Drawing; using ZXing; using iTextSharp.text; using iTextSharp.text.pdf; using System.Drawing; using System.Web.UI.WebControls; namespace PDFBarcode {     public partial class WebForm1 : System.Web.UI.Page     {         byte[] byteImage;         protected void Page_Load(object sender, EventArgs e)         {         }         protected void btnDownload_Click(object sender, EventArgs e)         {                       Random r = new Random();             string fileName = r.Next().ToString();             string filenameext = fileName + ".pdf";             GenerateBarcode(fileName);             string Sourcepath = Server.MapPath("~/SavedF...