Wednesday, October 19, 2016

Validation


1.Boş xana olduqda azərbaycan dilində istənilən texti çıxardır
<script>
 function InvalidMsg(textbox) {

        if (textbox.value == '') {
            textbox.setCustomValidity('Zəhmət olmasa işarəli xananı doldurun');
        }
       
        else {
            textbox.setCustomValidity('');
        }
        return true;
    }
</script>
<input type="text" name="txtFax" id="txtFax" class="form-control " placeholder="Telefon nömrəsi" oninput="InvalidMsg(this)" oninvalid="InvalidMsg(this)" required="required">

2.Ancaq rəqəm daxil edilsin
<script>
function isNumberKey(evt) {
        var charCode = (evt.which) ? evt.which : event.keyCode
        if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;
        return true;
    }
</script>

<input type="text" name="txt" id="txt" class="form-control input" placeholder="something" onkeypress="return isNumberKey(event);">


3.Texte max olcu vermek

<input type="text" name="txt" id="txt" class="form-control input" placeholder="something" maxlength="vermek istediyin olcu (mes=7)">

4.RadioButton hansi value secdiyini oyrenmek ucun

function getCheckedRadioValue(radioGroupName) {
        var rads = document.getElementsByName(radioGroupName),
            i;
        for (i = 0; i < rads.length; i++)
            if (rads[i].checked)
                return rads[i].value;
        return null; // or undefined, or your preferred default for none checked
    }

  var type = getCheckedRadioValue("myRadioButton");


How download file in controller action

  public ActionResult DownloadDocs(int requestParameter)
        {
                 
                    byte[] bytes =  //byte data

                    Response.Buffer = true;
                    Response.Clear();
                    Response.ContentType = mimetype;
                    Response.AddHeader("content-disposition", "attachment; filename=" + image_name + extention);
                    Response.BinaryWrite(bytes); // create the file
                    Response.Flush(); // send it to the client to download        

            return View();
        }


    <a href="@Url.Action("DownloadDocs", new { requestParameter= parameter })" target="_blank">Download file</a>

How to download a file through ajax request in asp.net MVC 4

public ActionResult DownloadAttachment(int requestParameter)
{          
    
    //blah blah

    byte[] fileBytes = System.IO.File.ReadAllBytes(file.Filepath);

    return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, file.Filename);                       

}

$(function () {
        $("#DownloadAttachment").click(function () {
            $.ajax(
            {
                url: '@Url.Action("DownloadAttachment", "PostDetail")',
                contentType: 'application/json; charset=utf-8',
                datatype: 'json',
                data: {
                    requestParameter: 123
                },
                type: "GET",
                success: function () {
                    window.location = '@Url.Action("DownloadAttachment", "PostDetail", new { requestParameter= 123 })';                }
            });

        });
    });

Saturday, October 1, 2016

Camtasia Studio 8 Crack

1.C diskine giririk
2. Gizli faylları görmək lazımdır .bunu üçün yuxarı panelde View->Hidden item seçirik
3.ProgramData -> TechSmith -> Camtasia Studio 8 ->RegInfo faylını açırıq
4.Aşağıdakıları copy edib ora atırıq

[COLOR=”Red”][RegistrationInfo] RegisteredTo=Any Name
RegistrationKey=KC2AC-ADZAM-CSWAW-NF6XZ-N56F8
ValidationData1=
ValidationData2=1
ValidationData3=1

faylı save edirik.

Friday, September 9, 2016

Solve: Your project references the latest version of Entity Framework (for Oracle) in Visual Studio 2013

1. Package Manager Console da 
PM> Install-Package 
Oracle.ManagedDataAccess.EntityFramework

2.Web config -ə aşağıdakı kodu əlavə etmək

 <entityFramework>
    <providers>
      <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </providers>
  </entityFramework>