Foxtable(狐表)用户栏目专家坐堂 → HTML中ID和标签如何设成变量?


  共有2176人关注过本帖树形打印复制链接

主题:HTML中ID和标签如何设成变量?

帅哥哟,离线,有人找我吗?
xietan417
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:731 积分:6493 威望:0 精华:0 注册:2011/6/26 11:45:00
HTML中ID和标签如何设成变量?  发帖心情 Post By:2018/3/21 16:11:00 [只看该作者]

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编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By: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
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:731 积分:6493 威望:0 精华:0 注册:2011/6/26 11:45:00
  发帖心情 Post By:2018/3/21 17:43:00 [只看该作者]

谢谢甜版

 回到顶部
帅哥哟,离线,有人找我吗?
xietan417
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:731 积分:6493 威望:0 精华:0 注册:2011/6/26 11:45:00
  发帖心情 Post By: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

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

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By: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>")


 回到顶部