分页传统的ASP和按钮改为超链接 [英] pagination classic asp, and button changed to hyperlinks

查看:507
本文介绍了分页传统的ASP和按钮改为超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建已编辑的CSS看起来像超链接,以便我可以使用,而不是使用查询字符串形式后的按钮。我做了它,这样当点击一个按钮,它为每个用户创建一个复选框。我希望它这样,当我改变复选框的状态,我希望它保存为我经历不同的字母。我相信我有这个问题是因为超链接是真正的按钮和改变复选框的选中状态正在创造的问题。我想preFER不使用JavaScript,但如果我的唯一的方式得到,我想那时我会用Java的脚本的结果。 code下面提供 -

 <形式的行动=Table.asp方法=后NAME =窗体2>
<输入类型=提交名称=按钮值=# style=\"background:transparent;border:0;display:inline;color:#00F;text-decoration:underline;padding:0px;cursor:pointer\">
<%对于i = 97〜122%GT;
     <输入类型=提交名称=按钮值=<%= CHR(I)%GT; style=\"background:transparent;border:0;display:inline;color:#00F;text-decoration:underline;padding:0px;cursor:pointer;\"> 
<%,明年%GT; < / BR>< / BR>< / BR> <%
    alphaB =的Request.Form(按钮)
 如果alphaB<>中,然后
        %GT;
        <输入类型=复选框NAME =复选框VALUE =<%= alphaB%GT; <%=会议(复选框)%>>
        <%
        回复于al​​phaB
 万一
alphaCheck =的Request.Form(复选框)如果alphaCheck<>中,然后
    会议(复选框)=选中
其他
    会议(复选框)=
万一


解决方案

你错了是你设置你的会话的地方...

移动

  alphaCheck =的Request.Form(复选框)
如果alphaCheck<>中,然后
    会议(复选框_&放大器; alphaCheck)=选中
其他
    会议(复选框_&放大器; alphaCheck)=
万一
...
<输入类型=复选框NAME =复选框VALUE =<%= alphaB%GT; <%=会议(复选框_&放大器; alphaB)%GT; />

复选框创建之前

发生什么是,在第一次一旦你打的页面会话未初始化

I've created buttons that have been edited with css to look like hyperlinks so I can use form post instead of using querystring. I've made it so that when a button is clicked it creates a checkbox for each user. I want it so that when i change the state of the checkbox I want it to save as I'm going through different letters. I believe the problem I am having is because the "hyperlinks" are really buttons and changing the checked state of a checkbox is creating problems. I would prefer not to use JavaScript but if its the only way for me to get the results that I want then I would use java-script. Code provided below -

<form action="Table.asp" method="post" name="form2">
<input type="submit" name="Button" value="#" style="background:transparent;border:0;display:inline;color:#00F;text-decoration:underline;padding:0px;cursor:pointer">
<% for i = 97 to 122 %>     
     <input type="submit" name="Button" value="<%=CHR(i) %>" style="background:transparent;border:0;display:inline;color:#00F;text-decoration:underline;padding:0px;cursor:pointer;">&nbsp;
<% next %>

 </br></br></br>

 <%
    alphaB = request.form("Button")
 if alphaB <>"" then
        %>
        <input type="checkbox" name="checkBox" value="<%=alphaB %>" <%=session("checkBox") %>>
        <%
        response.write alphaB


 end if


alphaCheck = request.form("checkBox")

if alphaCheck <>"" then
    session("checkBox") = "checked"
else
    session("checkBox") = ""
end if

解决方案

all you got wrong is the place where you set your session ...

move

alphaCheck = request.form("checkBox")
if alphaCheck <>"" then
    session("checkBox_"&alphaCheck) = "checked"
else
    session("checkBox_"&alphaCheck) = ""
end if 
...
<input type="checkbox" name="checkBox" value="<%=alphaB %>" <%=session("checkbox_"&alphaB ) %>/>

before the checkbox creation

what happen is that on the first time your session is not initialized once you hit the page

这篇关于分页传统的ASP和按钮改为超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆