문제

When I clicked on asp:button, it will prompt a save as dialog box. But I want to put default extension.

 function Open() {
        // var open = document.getElementById('<%=btnGenerate.ClientID %>>').click();
        var obj = document.getElementById('<%=rbtGenerateinpage.ClientID %>');
       // var path = "C:\Users\karthik.mushyam\Downloads";
        if (obj.checked == true) {
            window.open("WebForm1.aspx", "Page", "menubar=no, status=no, scrollbars=no, menubar=no, width=900, height=600");
        }   
        else {
            document.execCommand("SaveAs", true);
        }    
    }

Can anyone suggest me how can I put this .default extension to be .sql

도움이 되었습니까?

해결책

Assuming your issue with with the "SaveAs" command, the third parameter to execCommand is the name of the file to be saved as in:

document.execCommand("SaveAs", true, "myfile.sql");

Details are on this MSDN page.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top