Hi,
I have a scenario, where i need to show a confirm msg box, for user. i.e.
Please find the sample code for yout reference.
<form id="form1" runat="server"> |
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
</telerik:RadScriptManager> |
<div> |
<asp:Label ID="Label1" runat="server" ForeColor="Red" Visible="false"></asp:Label> |
<telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="None" |
InputSize="34" Width="225px" ReadOnlyFileInputs="true" AllowedFileExtensions=".xls" |
EnableFileInputSkinning="false"> |
<Localization Select="Browse" /> |
</telerik:RadUpload> |
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" OnClientClick="window.confirm('This will replace the current file. Do you want to continue?');" /> |
</div> |
</form> |
protected void Button1_Click(object sender, EventArgs e) |
{ |
Label1.Visible = true; |
if (RadUpload1.UploadedFiles.Count > 0) |
{ |
//Code to save the file |
Label1.Text = "File uploaded successfully"; |
} |
else |
{ |
Label1.Text = "Select a file to upload"; |
} |
} |
With this the RadUpload1.UploadedFiles.Count is becoming zero. So i am unable to upload the file.
I know that Upload control has some drawbacks in order to maintain security.
Help me.
Thanks & Regards,
Sudhanva.