Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with generated JScript code...
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Divers
Thread ID:
00876400
Message ID:
00876406
Vues:
9
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform