Posts

Cascading Dropdowns

<script type="text/javascript">            var continentsDDL = $('#<%=ddlCountry.ClientID%>');            var countriesDDL = $('#<%=ddlState.ClientID%>');            var citiesDDL = $('#<%=ddlCity.ClientID%>');            $.ajax({                url: '../webservice/service.asmx/ListofCountries',                method: 'post',                dataType: 'json',                success: function (data) {                    continentsDDL.append($('<option/>', { value: -1, text: 'Select Country' }));                    countriesDDL.append($('<option/>', { value: -1, text: ...

Grid view color change for particular cell

   <script>   $(document).ready(function(){          $(this).find("td:eq(0)").addClass('gridcolor'); });         $("#<%=gvConsCanList.ClientID%> tr").click(function (e) {             debugger;             var row = $(e.target).closest("tr");             //elem = row.children[0];             //alert(row.children[0]);             //ele = $(e.target).find('td:first-child').text();            //alert(ele.text());             //var cell1 = $(e.target).closest("td").prev("td").text();             var row = $(e.target).closest("tr");             var selectedcell = $(e.target).closest("td");             var cell0 ...

Split function in sql-server

 CREATE FUNCTION dbo.BreakStringIntoRows (@CommadelimitedString   varchar(1000)) RETURNS   @Result TABLE (Column1   VARCHAR(100)) AS BEGIN         DECLARE @IntLocation INT         WHILE (CHARINDEX(',',    @CommadelimitedString, 0) > 0)         BEGIN               SET @IntLocation =   CHARINDEX(',',    @CommadelimitedString, 0)                    INSERT INTO   @Result (Column1)               --LTRIM and RTRIM to ensure blank spaces are   removed               SELECT RTRIM(LTRIM(SUBSTRING(@CommadelimitedString,   0, @IntLocation)))                SET @CommadelimitedString = STUFF(@CommadelimitedString,   1, @IntLocation,...

Save entire gridview data into sql server

 for (int i = 0; i < gvConsCanList.Rows.Count; i++)         {             con.TRS= gvConsCanList.Rows[i].Cells[2].Text;             con.KUTAMI = gvConsCanList.Rows[i].Cells[3].Text;             con.BJP= gvConsCanList.Rows[i].Cells[4].Text;             con.Status = gvConsCanList.Rows[i].Cells[2].Text;             con.Const_name = gvConsCanList.Rows[i].Cells[1].Text;             con.OTHERS = gvConsCanList.Rows[i].Cells[5].Text;             bAL.iNSERTGridview(con);         }

Bootstrap time pikcer

<!DOCTYPE html> <html> <head> <meta charset =" utf-8 " /> <title> </title> <link href =" compiled-4.5.7.min.css " rel =" stylesheet " /> <style> .timepicker.picker__input.picker__input--active { border-bottom: 1px solid #e3f2fd } </style> </head> <body> <div class =" row "> <div class =" col-md-4 "> <input placeholder =" Selected time " type =" text " id =" input_starttime " class =" form-control timepicker "> <label for =" input_starttime "> </label> </div> </div> <script type =' text/javascript ' src =' https://mdbootstrap.com/wp-content/themes/mdbootstrap4/js/compiled-4.5.7.min.js?ver=4.5.7 '> </sc...

Image Resize and stored in server folder

                                                if (fileupload.HasFile)        {            imagename = txtimgtitle.Text;            string fileName = Path.GetFileName(fileupload.PostedFile.FileName);            string strpath = System.IO.Path.GetExtension(fileupload.PostedFile.FileName);            string dt = DateTime.Now.ToString("MM_dd_yyyy_hh_mm_ss") + "_";            Stream stream = fileupload.PostedFile.InputStream;            var image = ...

Insert thousand record at a time

alter procedure Insert100rows   as begin   declare @id int select @id = 1 while @id >=1 and @id <= 1000 begin     insert into HardwareDbTable(AssetName,Manufacturer,Model) values('jack' + convert(varchar(5), @id), 'dd','kk')     select @id = @id + 1 end end