I have the following code which is working fine on the development machine. But, when I deploy it to IIS, the .click() does not fire.
I have drop down box, when a status is selected, I add the following code to open up a RadWindow
if (ddlStatusID.SelectedValue.ToString() == "2") btnUpdateStatus.Attributes.Add("onclick", "return OpenWindow2('" + ResolveUrl("~/Request/AddBillableTime.aspx? RequestId=" + RequestId.ToString()) + "','650','320');"); else btnUpdateStatus.Attributes.Add("onclick", "");In the popup page, when the user clicks on a button I add do the following
ClientScript.RegisterStartupScript(this.GetType(), "CloseWindow", "ClosePopup();", true);
This is the ClosePopup javascript.
function ClosePopup() {
//debugger;
alert('This is before closing the window');
var oWindow = GetRadWindow();
oWindow.argument = null;
oWindow.close();
alert('This is after closing the window');
oWindow.BrowserWindow.ButtonClick();
}
In the main window, I have following javascript, which is invoked in the last line of the above javascript.
function ButtonClick() { //debugger; alert('This is before button click!'); var btnUpdateStatus = document.getElementById('ctl00_ContentPlaceHolder1_btnUpdateStatus'); alert('This is getting the button!'); btnUpdateStatus.setAttribute("onclick", ""); alert('This is setting the button!'); btnUpdateStatus.click(); alert('This is after clicking the button!');}
I have used the alerts to check how far the javascript function is executed.
The entire functionality is working fine when I run it using Visual Studio and also when I host it in my local IIS server. But, when I deploy it to the server, the click() event stops firing.
Please let me know if there is anything wrong in the code.