Apr 22, 2009, 4:50 AM
FileUploadField Script Bug
Hi,
When i place i FileUploadField on my form, the scriptmanager gives an error: "')' expected" after i call my save method.
This is my Save method:
In case of a textfield, the executescript is this:
Please Help, thanx.
When i place i FileUploadField on my form, the scriptmanager gives an error: "')' expected" after i call my save method.
This is my Save method:
Private Sub Save(ByVal CloseWindow As Boolean)
Dim ID As Integer
Dim Row As DataRow
Dim Result As ProcessResult
ID = Convert.ToInt32(Me.hiddenID.Text)
If ID > 0 Then
Row = UnitBusiness.GetUnit(ID)
Else
Row = UnitBusiness.CreateNewUnit()
End If
Result = Me.FillRowValuesFromControls(Row)
If (Result.GlobalSuccess) Then
Result = UnitBusiness.Save(Row)
If (Result.GlobalSuccess) Then
CooliteHelper.ParentAjaxMethod(Me.ScriptManagerMain, "RefreshStore", Row("ID").ToString())
If CloseWindow Then
CooliteHelper.RegisterCloseWindow(Me.ScriptManagerMain)
Else
Row.Table.DataSet.AcceptChanges()
Me.hiddenID.Text = Row("ID").ToString()
End If
Else
CooliteHelper.DisplayProcessResultToClient(Result, Me, Me.ScriptManagerMain)
End If
Else
CooliteHelper.DisplayProcessResultToClient(Result, Me, Me.ScriptManagerMain)
End If
End Sub
And this is the script i call via my Save method
Public Shared Sub ParentAjaxMethod(ByVal ScriptManager As ScriptManager, ByVal ParentAjaxMethod As System.String, ByVal Param As System.String)
Dim Js As System.String
Js = ""
Js += vbTab + vbTab + "try"
Js += vbCrLf + vbTab + vbTab + "{"
Js += vbCrLf + vbTab + vbTab + vbTab + "if (window.opener && !window.opener.closed)"
Js += vbCrLf + vbTab + vbTab + vbTab + "{"
Js += vbCrLf + vbTab + vbTab + vbTab + vbTab + "window.opener.Coolite.AjaxMethods." & ParentAjaxMethod & "(" & Param & ");"
Js += vbCrLf + vbTab + vbTab + vbTab + "}"
Js += vbCrLf + vbTab + vbTab + "}"
Js += vbCrLf + vbTab + vbTab + "catch(err)"
Js += vbCrLf + vbTab + vbTab + "{ // Permissions denied, do nothing "
Js += vbCrLf + vbTab + vbTab + "}"
ScriptManager.AddScript(Js)
End Sub
When i replace the fileuploadfield by a textfield or something else, everything works fine...In case of a textfield, the executescript is this:
try
{
if (window.opener && !window.opener.closed)
{
window.opener.Coolite.AjaxMethods.RefreshStore(48);
}
}
catch(err)
{ // Permissions denied, do nothing
} window.close();btnSave.setDisabled(false);btnSaveClose.setDisabled(false);txtStatus.setDisabled(false);cboForwarder.setDisabled(false);txtChassisNumber.setDisabled(false);cboConstructor.setDisabled(false);cboModel.setDisabled(false);cboDestination.setDisabled(false);chkActive.setDisabled(false);chkArchived.setDisabled(false);
in case of a fileuploadfield, the execute script is this:try
{
if (window.opener && !window.opener.closed)
{
window.opener.Coolite.AjaxMethods.RefreshStore(49);
}
}
catch(err)
{ // Permissions denied, do nothing
} window.close();btnSave.setDisabled(false);btnSaveClose.setDisabled(false);txtStatus.setDisabled(false);cboForwarder.setDisabled(false);txtChassisNumber.setDisabled(false);cboConstructor.setDisabled(false);cboModel.setDisabled(false);cboDestination.setDisabled(false);chkActive.setDisabled(false);chkArchived.setDisabled(false);
So u can see the '&&' is replaced by '&&'Please Help, thanx.