以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  HTML中ID和标签如何设成变量?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=116231)

--  作者:xietan417
--  发布时间:2018/3/21 16:11:00
--  HTML中ID和标签如何设成变量?
Select Case e.Path
    Case "","test.htm"
        Dim wb As New WeUI
        Dim str = wb.Build
        wb.AddPageTitle("","ph1","Progress")
        For i As Integer = 1 To 5
            wb.AddProgress("","pgb&\'"& i &"\'",True,50)  
        str = str.replace("<div class=\'weui_progress\' name= pgb& \'"& i & "\'  id= pgb& \'" & i & "\' >","<div class=\'weui_progress\' name= pgb& \'"& i &"\'  id= pgb& \'"& i &"\' ><label>合同&‘“&i&"\':</label>")        
        Next           
       e.WriteString(str)
End Select


帮忙改一下以上代码
[此贴子已经被作者于2018/3/21 16:11:58编辑过]

--  作者:有点甜
--  发布时间:2018/3/21 17:13:00
--  

Select Case e.Path
    Case "test.htm", ""
        Dim wb As New WeUI
       
        wb.AddPageTitle("","ph1","Progress")
        For i As Integer = 1 To 5
            wb.AddProgress("","pgb" & i ,True,50)
        Next
        Dim str = wb.Build
        For i As Integer = 1 To 5
            str = str.replace("<div class=\'weui_progress\' name=\'pgb" & i & "\' id=\'pgb" & i & "\'>" & chr(13) & chr(10) & " <div class=\'weui_progress_bar\'><div class=\'weui_progress_inner_bar\' style=\'width:50%;\'>","<div class=\'weui_progress\' name=\'pgb" & i & "\' id=\'pgb" & i & "\'>" & vbcrlf & " <div style=\'height:30px\' class=\'weui_progress_bar\'><div class=\'weui_progress_inner_bar\' style=\'width:50%;\'><label>合同" & i & ":</label>")
        Next

        e.WriteString(str)
End Select


--  作者:xietan417
--  发布时间:2018/3/21 17:43:00
--  
谢谢甜版
--  作者:xietan417
--  发布时间:2018/3/22 16:27:00
--  
Select Case e.Path
    Case "test.htm", ""
        Dim wb As New WeUI
        Dim drs As List(of DataRow) = DataTables("合同管理").SQLSelect("")
        wb.AddPageTitle("","ph1","Progress")
        For i As Integer = 1 To drs.Count
            wb.AddProgress("","pgb" & i,True,drs(i-1)("progress"))
        Next
        Dim str = wb.Build
        For i As Integer = 1 To drs.Count
            str = str.replace("<div class=\'weui_progress\' name=\'pgb" & i & "\' id=\'pgb" & i & "\'>" & chr(13) & chr(10) & " <div class=\'weui_progress_bar\'><div class=\'weui_progress_inner_bar\' style=\'width:50%;\'>","<div class=\'weui_progress\' name=\'pgb" & i & "\' id=\'pgb" & i & "\'>" & vbcrlf & " <div style=\'height:30px\' class=\'weui_progress_bar\'><div class=\'weui_progress_inner_bar\' style=\'width:50%;\'><label>" & drs(i-1)("合同简称") & "</label>")
        Next
        e.WriteString(str)
End Select

红色代码位置用纯数字时,标签名称正常显示,换成变量后,标签名称就无法正常显示了!求解!

--  作者:有点甜
--  发布时间:2018/3/22 16:36:00
--  

把红色代码改一下

 

str = str.replace("<div class=\'weui_progress\' name=\'pgb" & i & "\' id=\'pgb" & i & "\'>" & chr(13) & chr(10) & " <div class=\'weui_progress_bar\'><div class=\'weui_progress_inner_bar\' style=\'width:" & drs(i-1)("progress") & "%;\'>","<div class=\'weui_progress\' name=\'pgb" & i & "\' id=\'pgb" & i & "\'>" & vbcrlf & " <div style=\'height:30px\' class=\'weui_progress_bar\'><div class=\'weui_progress_inner_bar\' style=\'width:" & drs(i-1)("progress") & "%;\'><label>" & drs(i-1)("合同简称") & "</label>")