vbscript中字符串问题

来源:百度知道 编辑:UC知道 时间:2024/05/15 07:42:48
我写的程序是一个显示帖子,当当前用户为该帖子发表者就显示“编辑”和“删除”按钮,按钮用HTML实现为
编辑:<button onClick="window.location='reflect_action.asp?action=edit&re_id=<%= rs("re_id") %>'">编辑</button>
删除:<button onClick="{if(confirm('您再次确定要删除此条回复吗?\n\n注意:删除后不可恢复!')){window.location='reflect_action.asp?action=delete&re_id=<%= rs("re_id") %>';}return false;}">删除</button>

现在我想设两个变量 dim button_edit , button_delete

然后从数据库读出这个帖子的发布者rs("user_id"),由于用户登录我是将用户保存到了application("cur_user")中的,所以想
if rs("user_id") = application("cur_user") then
button_edit = "<button...编辑...</button>"(这儿实现不了)
button_delete = "<button...删除...</button>"(这儿实现不了)
else
button_edit = ""
button_edit = ""
end if
请大家告诉我怎样做?

button_edit="<button onClick=""window.location='reflect_action.asp?action=edit&re_id="& <%= rs("re_id")%>&"'"">编辑</button>"
我写一个给你做参考.另一个不是不写.是让你自己去实现.就当练习!
方法很简单.就是字符串如果你想把它当字符串输出的话.你就需要把里面的"号换成""号.