Ciao ragazzi,
allora dal forum ho preso questo cript che covrebbe far andare in neretto le cose entro i tag [z][/z].
Problema è che mi da il seguente errore:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30205: End of statement expected.
Source Error:
Line 21: End Sub
Line 22: Function Formatta(testo as string,virtualTag as string,htmlTag as String)
Line 23: Dim PatternTag as string = "\[" & virtualTag & "\](.*?)\[\/" & virtualTag & "\]" <FONT color=silver>'"\[z\](.*?)\[\/z\]"</FONT>
Line 24: Dim ReplaceTag as string = "<" & htmlTag & ">$1</" & htmlTag & ">" <FONT color=silver>'"$1"</FONT>
Line 25: testo = Replace(testo, Chr(10), "
")
Source File: http://localhost/Ariel/WebForm1.aspx Line: 23
Ecco il codice, sapete dirmi dove sbaglio??
<script language="vb" runat="server">
Sub Page_Load
Dim stringaTest as string
stringaTest = "proviamo a [z][z][z]mettere sotto [z]stress[/z]il test[/z], " & _
"se funziona il continuo [/z][/z][z][z]annidamento[/z] di grassetti..[/z], e altre sezioni [z]ben formattate[/z]"
Response.Write(Formatta(stringaTest,"z","b"))
End Sub
Function Formatta(testo as string,virtualTag as string,htmlTag as String)
Dim PatternTag as string = "\[" & virtualTag & "\](.*?)\[\/" & virtualTag & "\]" <FONT color=silver>'"\[z\](.*?)\[\/z\]"</FONT>
Dim ReplaceTag as string = "<" & htmlTag & ">$1</" & htmlTag & ">" <FONT color=silver>'"$1"</FONT>
testo = Replace(testo, Chr(10), "
")
Dim objRegExp As New System.Text.RegularExpressions.Regex(PatternTag)
while objRegExp.IsMatch(testo)
testo = objRegExp.Replace(testo,ReplaceTag)
end while
return testo
End Function
</script>
Dove va messo nel WebForm.aspx o nel WebForm.aspx.vb??
Grazie
spider81man

Rispondi quotando