In layman’s terms, basically what I want to do is:
I am exporting a dataset to a csv file, should the file exceed a predetermined size allow the user the option to email instead of downloading.
(So if the file > 10Mb Alert msg with option to email or to carry on downloading)
I.E “click yes to email, click no to download”
and
Retrieve the users selection
Any guidance would be appreciated.
Edited: Ok here is what I have tried
Script
function confirmBox()
{
var hSize = document.getElementById('<%= hFileSize.ClientID %>');
if (hSize.value > 100)
{
if (confirm(" Values is greater than 100. Continue?")==true)
return true;
else
return false;
}
}
Asp button:
<asp:Button ID="cmdExport" runat="server" Text="Export" OnClick="cmdExport_Click" OnClientClick="return confirmBox();"/>
But the problem is the message box is generated client side before the code behind has run to generate the CSV file and to get the File Size. So the message box needs to display only once I have generated the CSV and got the file size?
I managed to solve my problem by using a third party Telerik which I’m currently using.
By implementing Radtooltips/Radwindows. http://www.telerik.com/