I have a very simple line of code in javascript. But in Chrome it throws an error "System.FormatException: Input string was not in a correct format."
Does anyone know why?
var
dialogWindow = $find('<%=WebDialogWindow2.ClientID%>');
Sorry I didn't respond sooner. Yes, this solved the problem. Thanks for the help.
Hello,
Were you able to solve this issue? Please let us know whether the above solution worked for you.
Hi Scott,
If $find(id) fails, then you may try to debug by searching that id within source of html. For example, you may
alert("id=<%=WebDialogWindow2.ClientID%>");
look at that value and search html source for that string. There is should be javascript ..create(...id..) statement.
If dialog is returned, then I suggest to use members of contentPane, rather then explicit references to internal members. For example, $IG.LayoutPane (get_contentPane) object has several members like
var cp = dialogWindow.get_contentPane();var contentBody = cp.getBody();var iframe = cp.get_iframe();var targetUrl = cp.get_contentUrl();// following will persist after postbackcp.set_contentUrl(anotherAspxOrWebSite);// following will not persist after postbackif(iframe) iframe.src = anotherAspxOrWebSite;// find child html elementvar textBox1 = cp.findChild("TextBox1");
Hristo,
The function is below. I basically modeled this function after one in the samples. It's just trying to open a webdialog control, version 10.3.20103.2120. We are then trying to change the content on the dialog to display a jpg. But the code fails on the $find statement. This works fine in IE, but not in Chrome. However, we do have other dialog windows that are functioning fine in Chrome.
function
PicSelect(gridName, cellId, button) {
// Get the cell
var cell = igtbl_getCellById(cellId);
if (cell.Column.Key == "Photo") {
// Get the row
var selRow = null;
selRow = cell.getRow();
var TargetURL = selRow.getCell(10).getValue();
dialogWindow = $find(
'<%=WebDialogWindow2.ClientID%>');
var contentPane = dialogWindow.get_contentPane();
contentPane._DIV.children(0).src = TargetURL;
dialogWindow.show();
}
Hello Scott,
I don't think that this line cause the error. Can you share your markup code with us.
Thank you