Posts

Showing posts from December, 2018

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,...