Thursday, June 2, 2016

General Knowledge.


1.Skype shares by default Port 80. So some time we are not able to restart our once we have stopped it. This is because port issue. So logout your Skype and then restart your IIS.

2.Sometimes when we attach our code to IIS then breakpoint is not hitting in code in debug mode this is happening because code mismatched from local to IIS. In that case just re-publish the code to IIS. And attach your code to IIS worker process (W3Wp.exe).

3.Returning JS serialized object from any uploader will be seen as data object in JS code.
Ex:
context.Response.ContentType = "text/html";
productReturnInfo.Success = false;
productReturnInfo.ErrorMessage = ex.Message;
JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
string returnObject = jsSerializer.Serialize(productReturnInfo);
context.Response.Write(returnObject);

jQuery.support.cors = true;
    jQuery.ajaxFileUpload({
        url:,
        fileElementId: uploadCtrlID,
        async: false,
        sizeLimit: 10000000,
        success: function (data, status) {




4.Sometime we need to replace some pages may be old or newly created in IIS. So how to do that. First we just build the project and copy only the front-end .aspx page to IIS and take the project dll from build project inside bin folder and copy it to IIS bin folder.

5.Sometime we are facing problem with building very slow in VS 2008 in that case we need to replace one file and set one system environmental variable name DoPlatformVerificationTask as variable value false in windows. Microsoft.CompactFramework.Common.targets is the file.

6.http://www.aspdotnet-suresh.com/search/label/JQuery some jquery solutions.

7.When we create any composite key by default all columns are set as not null which is hidden  to us. So we cannot insert any null values while inserting to the table. But once we delete  the composite key this not null property will be removed from the columns. So better is to  define these columns with not null constraint.

8. wSheet.Cells[rowindex, columnindex] = new Cell(complementaryMaterial.Trim(), "@");
     for making the excel column as text.
9. if (materialNumber.Length > 0 || stdRate > 0 || qualityMethod.Length > 0 ||                   complementaryMaterials.Length > 0 || complementaryIDHArray.Length > 0                       for ignoring the blank row of excel.

10.string abc=string.join(“’,’”,omlist);
   sqlCmdBuilder.Append(" AND ABC IN (‘" + abc.Trim() + "’) ");
   for inputing as single quoted words separated by comma in a big string.
   one more example below here

   string[] stringArray= stringvalue.Split(',');
                string abc= string.Empty;
                foreach (string abc12 in stringArray)
                {
                    abc+= "'" + abc12 + "'" + ",";

                }

   sqlCmdBuilder.Append(" AND ABC IN (" + abc.Trim() + ") "); 

11.
jQuery("#" + hdnVariable).val(JSON.stringify(object));//setting object to a hidden variable

objectInfo obj32434 = (new JavaScriptSerializer()).Deserialize<objectInfo>(hdnVariable.Value);

objectInfo obj32434444 = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<objectInfo>(hdnVariable.Value);

retrieving it in an object in backend.

12.
function isNumberKey(evt, element) {
    var charCode = (evt.which) ? evt.which : event.keyCode;
    if ((charCode != 45 || $(element).val().indexOf('-') != -1) && (charCode != 46 || $(element).val().indexOf('.') != -1) && (charCode < 48 || charCode > 57))
        return false;
    else {
        // Set minus character at the beginning of the line
        if (charCode == 45) {
            evt.preventDefault();
            $(element).val(String.fromCharCode(charCode) + $(element).val());
        }
        return true;
    }
} 

13.
for stopping request of ajax call on disabled button
if (jQuery("#" + btnDownloadSampleData).is('[disabled=disabled]') == true) {
        return false;
    }     

14. for image animation bigger:
=============================================================================================
http://malsup.com/jquery/hoverpulse/         

Applying cookies on my blog:
https://github.com/insites/cookieconsent
https://privacypolicies.com/blog/eu-cookie-law/









































































No comments:

Post a Comment

Things to carry while travelling

 Kapda 1)3 jeans. 2)5 chaddi. 3)4 short pant. 4)1 taulia. 5)1 Topi. 6)1 paijama. 7)3 T-shirt. 8)3 Shirt. 9)Ganji 5. 10)1 inner ware mota. Fr...