I need a function like the ShowAlert button in this demo
http://demos1x.telerik.com/aspnet/Window/Examples/BrowserDialogBoxes/DefaultCS.aspx
However instead of invoking a popup window by a button click, as in the demo, I want to invoke the popup window inside an IF statement in the code behind of a user control.
After the user clicks "Yes" or "Cancel" the value of this user selection needs to be returned to the IF statement in the code behind.
In other words, I need almost the same thing as the demo except the modal popup window needs to be triggered in the code behind instead of by the user clicking on a button.
More specifically, I am using a RadUpload. After the user selects (browses for) a file, I check the filename. If the name is non-standard I want a modal popup to warn the user and ask if the user wants to proceed.
protected void buttonUpload_Click(object sender, EventArgs e)
{
FileNameType fileType = (FileNameType)Enum.Parse(typeof(FileNameType), RadComboBoxUploadType.SelectedValue);
foreach (UploadedFile file in RadUploadSCS.UploadedFiles)
{
string mg = msgFileOK(file.FileName, RadComboBoxUploadType.SelectedItem.Text);
if (mg.Length > 0)
...Here I want to popup the window and get a yes/cancel response back from the user