just nu har jag bara gjort en klass med alla vanliga funktioner, ingen code-behind ännu. Tänkte testa först, eftersom det är ett väldigt stort steg att göra om allt till code-behind. Så då tänkte jag låta den vanliga .aspx-sidan ärva min class vanliga som då har alla vanliga funktioner i sig.
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Data.OleDb
Imports System.Web.Security
Public Class Vanliga : Inherits PageBase.StandardPage
function free(txt)
txt = Replace(txt, "<", "<")
txt = Replace(txt, ">", ">")
txt = Replace(txt, ":)", "<img src=""smileys/smile.gif"">")
txt = Replace(txt, ":(", "<img src=""smileys/frown.gif"">")
txt = Replace(txt, ":r", "<img src=""smileys/shame.gif"">")
txt = Replace(txt, ":D", "<img src=""smileys/biggrin.gif"">")
txt = Replace(txt, ";)", "<img src=""smileys/wink.gif"">")
txt = Replace(txt, ":P", "<img src=""smileys/tongue.gif"">")
txt = Replace(txt, ":h", "<img src=""smileys/cool.gif"">")
txt = Replace(txt, ":@", "<img src=""smileys/angry.gif"">")
txt = Replace(txt, ":o", "<img src=""smileys/oh.gif"">")
txt = Replace(txt, ":q", "<img src=""smileys/quest.gif"">")
txt = Replace(txt, ":birp", "<img src=""smileys/beergrin.gif"">")
txt = Replace(txt, ":bire", "<img src=""smileys/bire.gif"">")
txt = Replace(txt, "=P", "<img src=""smileys/blah.gif"">")
txt = Replace(txt, ":x", "<img src=""smileys/dead.gif"">")
txt = Replace(txt, ":stud", "<img src=""smileys/stud.gif"">")
txt = Replace(txt, ":s", "<img src=""smileys/devil.gif"">")
txt = Replace(txt, ":bak", "<img src=""smileys/devilgrin.gif"">")
txt = Replace(txt, ":f", "<img src=""smileys/flirt.gif"">")
txt = Replace(txt, "=/", "<img src=""smileys/hrmpf.gif"">")
txt = Replace(txt, ":i", "<img src=""smileys/idea.gif"">")
txt = Replace(txt, "kuk", "*censur*")
txt = Replace(txt, "fitta", "*censur*")
txt = Replace(txt, "bög", "*censur*")
txt = Replace(txt, "hora", "*censur*")
txt = Replace(txt, "=D", "<img src=""smileys/supergrin.gif"">")
txt = Replace(txt, "!P", "<img src=""smileys/jaja.gif"">")
txt = Replace(txt, ":'D", "<img src=""smileys/laugh.gif"">")
txt = Replace(txt, "8-)", "<img src=""smileys/look.gif"">")
txt = Replace(txt, "Y-)", "<img src=""smileys/moose.gif"">")
txt = Replace(txt, "*tihi*", "<img src=""tihi.gif"">")
txt = Replace(txt, vbcrlf, "<br>")
txt = Replace(txt, "'", "''")
free = txt
end function
End Class
i min vanliga .aspx-sida ligger:
<%@ Page Language="VB" inherits="vanliga" src="vanliga.vb" validaterequest="false" debug="true" %>
nåt mer viktigt?