以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 点击按钮,传递数据,进入下一个页面 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=98654) |
-- 作者:zhangjian222200 -- 发布时间:2017/4/4 13:09:00 -- 点击按钮,传递数据,进入下一个页面 这样一个页面,希望点击按钮,进入index.htm,获得会员性别是男生还是女生 点击按钮后如何增加cookie,或者有其他什么办法? Dim e As RequestEventArgs = args(0) Select Case e.Path Case "index0.htm" Dim wb As New weui With wb.AddArticle("","ar1") .AddImage("./images/langwo/logo1.jpg") .Attribute = "style=\'padding:0em;\'" End With wb.AddForm("","form1","index0.htm") With wb.AddButtonGroup("form1","btg1",False) .Add("btn1", "男生","/index.htm") .Add("btn1", "女生","/index.htm").kind = 1 End With e.WriteString(wb.Build) \'生成网页 End Select
|
-- 作者:有点蓝 -- 发布时间:2017/4/4 13:32:00 -- .Add("btn1", "男生","/index.htm?sex=1") .Add("btn1", "女生","/index.htm?sex=0").kind = 1 使用get参数
|
-- 作者:zhangjian222200 -- 发布时间:2017/4/4 13:39:00 -- 在index.htm页面,如何引用sex参数 dim a as string = e.getvalues(sex),这样可以吗?
[此贴子已经被作者于2017/4/4 13:46:09编辑过]
|
-- 作者:有点蓝 -- 发布时间:2017/4/4 14:06:00 -- http://www.foxtable.com/mobilehelp/scr/0113.htm |
-- 作者:zhangjian222200 -- 发布时间:2017/4/4 15:27:00 -- 原因找到了,少了引号 index0.htm页面代码是这样的 Dim e As RequestEventArgs = args(0) \'注册第4页,完善资料 Select Case e.Path Case "index0.htm" Dim wb As New weui With wb.AddArticle("","ar1") .AddImage("./images/langwo/logo1.jpg") .Attribute = "style=\'padding:0em;\'" End With wb.AddForm("","form1","index0.htm") With wb.AddButtonGroup("form1","btg1",False) .Add("btn1", "男生","/index.htm?sex=1") .Add("btn2", "女生","/index.htm?sex=0").kind = 1 \'.Attribute = "style=\'padding:0.5em;\'" End With e.WriteString(wb.Build) \'生成网页 End Select 点击男生或女生按钮,居然还是跳转到index0.htm,见下图(httprequest页面引用代码,多遍检查,确认正常) 增加红色引号即可 .Add("btn1", "男生","","/index.htm?sex=1") .Add("btn2", "女生","","/index.htm?sex=0").kind = 1 [此贴子已经被作者于2017/4/4 15:33:12编辑过]
|
-- 作者:有点蓝 -- 发布时间:2017/4/4 15:35:00 -- .Add("btn1", "男生","","/index.htm?sex=1") .Add("btn2", "女生","","/index.htm?sex=0").kind = 1
|
-- 作者:zhangjian222200 -- 发布时间:2017/4/4 15:45:00 -- 代码中,msgbox没有执行 问题描述,见下述粉色部分 Dim e As RequestEventArgs = args(0) \'首页 Select Case e.Path Case "index.htm" Dim wb As New weui With wb.AddTabBar("", "tb1", 1) \'使用TabBar,增加4个按钮(注:页面可以增加,但不考虑) .AddButton("bt1","首页","./images/a.png","http://www.foxtable.com") .AddButton("bt2","记录","./images/b.png","http://www.foxtable.com") .AddButton("bt3","设置","./images/c.png","http://www.foxtable.com") .AddButton("bt4","我的","./images/d.png","/personal.htm") .Attribute = "style=\'height:55px\'" End With Dim username As String = e.cookies("isj") \'从cookie取用户名(手机号) Dim drs As List(of DataRow) Dim dr As DataRow = DataTables("会员资料").sqlFind("手机 = \'" & username & "\'") Dim xb As String \'定义,性别(未登录) For Each key As String In e.GetValues.Keys If key = "sex" Then xb = e.GetValues(key) msgbox(xb) ’这个没有执行 End If Next If username IsNot Nothing Then If dr("性别") = "男" Then \'如果会员男生,则显示女生 drs = DataTables("会员资料").SQLSelect("[性别] = \'女\'") \',10,"发起_日期 DESC") \'从订单表找,个人订单集合 ElseIf dr("性别") = "女" Then \'如果会员是女生,则显示男生 drs = DataTables("会员资料").SQLSelect("[性别] = \'男\'") \',10,"发起_日期 DESC") \'从订单表找,个人订单集合 ElseIf dr("性别") = "" Then \'如果会员是男女为空,跳转到确认男女生页面 msgbox("请重新登录,并检查到会员中心-基本资料,检查性别是否存在!") End If Else If xb ="1" Then \'如果未登录,且是男生:展示女生 drs = DataTables("会员资料").SQLSelect("[性别] = \'女\'") \',10,"发起_日期 DESC") \'从订单表找,个人订单集合 ElseIf xb = "0" Then \'如果未登录,且是女生:展示女生 drs = DataTables("会员资料").SQLSelect("[性别] = \'男\'") \',10,"发起_日期 DESC") \'从订单表找,个人订单集合 ElseIf xb = "" Then \'如果未登录,且是男女生未知:进入确认男女生页面 wb.InsertHTML("<meta http-equiv=\'Refresh\' c>") \'这里正常跳转到index0.htm \'e.WriteString(wb.Build) \'生成网页 End If End If ********其他代码 e.WriteString(wb.Build) \'生成网页 End Select index.htm代码: Dim e As RequestEventArgs = args(0) Select Case e.Path Case "index0.htm" Dim wb As New weui With wb.AddArticle("","ar1") .AddImage("./images/langwo/logo1.jpg") .Attribute = "style=\'padding:0em;\'" End With wb.AddForm("","form1","index0.htm") With wb.AddButtonGroup("form1","btg1",False) .Add("btn1", "男生","","/index.htm?sex=1") \'此处能正常跳转到index.htm页面 .Add("btn2", "女生","","/index.htm?sex=0").kind = 1 \'.Attribute = "style=\'padding:0.5em;\'" End With e.WriteString(wb.Build) \'生成网页 End Select [此贴子已经被作者于2017/4/4 15:47:53编辑过]
|
-- 作者:有点蓝 -- 发布时间:2017/4/4 16:07:00 -- 测试没有问题 Select Case e.Path Case "index0.htm" Dim wb As New weui With wb.AddArticle("","ar1") .AddImage("./images/langwo/logo1.jpg") .Attribute = "style=\'padding:0em;\'" End With wb.AddForm("","form1","index0.htm") With wb.AddButtonGroup("form1","btg1",False) .Add("btn1", "男生","","/index.htm?sex=1") \'此处能正常跳转到index.htm页面 .Add("btn2", "女生","","/index.htm?sex=0").kind = 1 \'.Attribute = "style=\'padding:0.5em;\'" End With e.WriteString(wb.Build) \'生成网页 Case "index.htm" Dim wb As New weui e.WriteString( e.GetValues("sex")) \'生成网页 End Select |
-- 作者:zhangjian222200 -- 发布时间:2017/4/4 16:12:00 -- 重新执行,msgbox(xb)正常了
[此贴子已经被作者于2017/4/4 16:18:37编辑过]
|