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