这个indexb.htm是插入到index.htm的页面,
当第1次点击index.htm页面底部“加载更多”时,msgbox(xb),显示“男”,值传递正常
当第2次点击index.htm页面底部“加载更多”时,msgbox(xb),显示“”,按道理这里应该还是显示“男”
但是,2个页面及其他页面,都没有执行e.DeleteCookie("xingbcd"),这是什么原因?
下述代码其他msgbox都显示了,只是第二次起,msgbox(xb),显示的值不是cookie的值
Dim e As RequestEventArgs = args(0)
Select Case e.Path
Case "indexb.htm"
Dim wb As New weui
Dim drs As List(of DataRow) '用于存放后续插入页面的会员编号集合
Dim i As Integer '记录首页展示人数,即for each语句循环次数
Dim xb As String = e.cookies("xingbcd") '从index.htm页面,性别传递,取用户性别
Dim bianhsz As String = e.cookies("bianhcd") '从index.htm页面,编号传递,取最小用户编号(编号是一串数字,因为每次增加会员+1,所以可以用来sqlselect)
msgbox(xb)
If xb = "男" Then '如果会员女生,则显示男生
msgbox("我是男生")
drs = DataTables("会员资料").SQLSelect("[性别] = '女' and [会员编号] < '" & bianhsz & "'",4,"会员编号 DESC") '从订单表找,个人订单集合
Else '其他情况,显示男生
msgbox("我是女生")
drs = DataTables("会员资料").SQLSelect("[性别] = '男' and [会员编号] < '" & bianhsz & "'",4,"会员编号 DESC") '从订单表找,个人订单集合
End If
'msgbox(13)
'wb.AddForm("","form1","indexb.htm") '不需要此行(此行是index.htm页面控制需要而加的,本页不需要)
For Each dr As DataRow In drs
'msgbox(13-1)
Dim zhansz As String = dr("展示照") '定义,年龄
Dim bianh As String = dr("会员编号") '定义,年龄
Dim nianl As String = dr("年龄") '定义,年龄
Dim xuel As String = dr("学历") '定义,学历
Dim huny As String = dr("婚姻状况") '定义,婚姻状况
Dim suozqx As String = dr("所在区县") '定义,所在区县
Dim suozshi As String = dr("所在市") '定义,所在市
Dim suozs As String = dr("所在省") '定义,所在省
'msgbox(14)
With wb.AddArticle("","ar" & bianh)
.AddImage("./" & zhansz)
'.AddImage("./images/zhanshi/" & zhansz)
msgbox("编号:" & bianh & "照片:" & zhansz)
.Attribute = "style='padding:0.5em;'"
End With
wb.AddForm("","form" & bianh,"indexb.htm")
'msgbox(15)
With wb.AddInputGroup("form" & bianh,"ipg" & bianh,"TA的编号:" & bianh)
With .AddInput("xm" & bianh,"有关于TA:","text")
.Value = nianl & "岁|" & xuel & "|" & huny
.Readonly= True
End With
With .AddInput("pw" & bianh,"所在城市:","text") ' "'">"'" ,表达式留存
.Value = suozqx & ">" & suozshi & ">" & suozs
.Readonly= True
End With
End With
With wb.AddButtonGroup("form" & bianh,"btg" & bianh,False)
.Add("btn1" & bianh, "查看TA的资料", "","/details.htm")
End With
i = i + 1
If i = 4 Then
'这里需要传递:会员性别|当前编号|会员等级
e.AppendCookie("bianhcd",bianh) '编号传递,将本页展示的最后一个需要存入cookie,为index.htm,调用下一个插入页面,准备开始序号(sqlselect用)
msgbox(bianh)
End If
Next
e.WriteString(wb.Build) '生成网页
End Select
这是index.htm页面代码:
[此贴子已经被作者于2017/4/11 15:53:59编辑过]