menu

天魔窟

勇往直前

Avatar

新的 UBB 标签测试……

“代码”标签(code):

using System;

public class HelloWorld
{
	static void Main()
	{
		Console.WriteLine("Hello, world!");
	}
}


“引用”标签(quote):

引用人家的东西……

写 code 这个新标签的时候遇到一些问题。之前,我为了保证 HTML 内容中的文本格式和发表时一致(主要是换行和空格,HTML 忽略连续的空格以及 \r\n),除了 HTMLEncode 以外,还把换行符(vbCrLf or \r\n)Replace 成了 <br>,把空格 Replace 成了 &nbsp;。但是,这样的话,长篇的英文文字会遇到不能自动在容器边缘换行的问题,我估计是因为把英文中的空格都 Replace 掉了的缘故(HTML 本身可以自动处理一些换行的……),然而,又要保证代码中的空格(通常是缩进),于是我修改了一下,把连续的 2 个空格替换(以前是连 1 个空格也替换),这样,一般的中文文章的开头空格可以保留,代码的缩进也能保留,而一个空格是能被 HTML 所自动保留的。

Yeah...

哦……


<%
Sub ShowHelloWord
    dim HelloWorld
    HelloWorld = "Hello, world!"
    Response.Write HelloWorld
End Sub
%>

就是保持空格和缩进吧?

强。。。

能过滤的都过滤了。。。

我也来

弓虽

现在的方案也不算完美……
正在写 UBB 代码的简单帮助,呵呵

怎么没有quote, 我拼错了么?

Sub dgrdProducts_UpdateCommand( s As Object, e As DataGridCommandEventArgs )
	Dim intProductID As Integer
	Dim txtUnitPrice As TextBox
	Dim decUnitPrice As Decimal
	
	If IsValid Then
		intProductID = dgrdProducts.DataKeys( e.Item.ItemIndex )
		txtUnitPrice = e.Item.FindControl( "txtUnitPrice" )
		decUnitPrice = txtUnitPrice.Text
		strSql = "Update Products Set UnitPrice=@UnitPrice Where ProductID=@ProductID"
		cmdSql = New SqlCommand( strSql, conNorthwind )
		cmdSql.Parameters.Add( "@UnitPrice", decUnitPrice )
		cmdSql.Parameters.Add( "@ProductID", intProductID )
		conNorthwind.Open()
		cmdSql.ExecuteNonQuery()
		conNorthwind.Close()
		dgrdProducts.EditItemIndex = -1
		BindDataGrid
	End If
End Sub

...

..

紧挨标签的字符不可以为空白


1



2

1
11

评论已关闭