Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with generated JScript code...
Message
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00876400
Message ID:
00876406
Views:
10
>I need to generate a call for onChange of some controls generated in server-side. The code is (in the ASPX vb.net page):
>
>
>lcFuncion = "return MostrarValorCombo(this," + lcControlCombo + ",'" + oControl.Tabla + "','" + oControl.CampoCodigo + "','" + oControl.CampoDescripcion + "'," + lcValidar + ");"
>
> If oControl.EditBox.Attributes.Item("onChange") <> "" Then
> oControl.EditBox.Attributes.Item("onChange") = oControl.EditBox.Attributes.Item("onChange") + "&&" + lcFuncion
> Else
> oControl.EditBox.Attributes.Add("onChange", lcFuncion)
> End If
>
>So, in html, the code MUST look this way:
>
>,true)&& return Asignar
>
>But is generated this way:
>
>,true);&&return Asignar
>
>I don't put the ; or & and that cause to fail the script..
>
>How avoid it???

Mario;

You might try placing a space after the last & and before the last double quote. "&& "
If oControl.EditBox.Attributes.Item("onChange") <> "" Then
oControl.EditBox.Attributes.Item("onChange") =              oControl.EditBox.Attributes.Item("onChange") + "&& " + lcFuncion
Else
oControl.EditBox.Attributes.Add("onChange", lcFuncion)
End If
Or try + “ “ + after your "&&"

Tom
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform