首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

&与&amp 转换有关问题 刚才说的不清楚结了换这张继续

2011-12-20 
&与& 转换问题 刚才说的不清楚结了换这张继续pagelist.Attributes.Add(onchange, self.location.hre

&与&amp 转换问题 刚才说的不清楚结了换这张继续
pagelist.Attributes.Add("onchange", "self.location.href='userlist.aspx?page='+this.options[this.selectedIndex].value+" + "'&selKind =" + sKind + "&txtKey =" + sKey + "&isSearch=" + isSearch+"'");

在源码的显示成
<select name="pagelist" id="pagelist" class="minbox" onchange="self.location.href='userlist.aspx?page='+this.options[this.selectedIndex].value+'&amp;selKind =&amp;txtKey =&amp;isSearch='" style="margin-top:6px;width:60px;">

为什么&变成了&amp 怎么解决

[解决办法]
& 前加 "\"
[解决办法]
没关系的,不影响使用
[解决办法]

改成:

pagelist.Attributes.Add("onchange", "self.location.href= 'userlist.aspx?page= "+this.options[this.selectedIndex].value+"&selKind =" + sKind + "&txtKey =" + sKey + "&isSearch=" + isSearch+"'");
[解决办法]
改成下邊這個試試,最好不要多出空格:
pagelist.Attributes.Add("onchange", "self.location.href= 'userlist.aspx?page= '"+this.options[this.selectedIndex].value+"'&selKind=" + sKind + "&txtKey=" + sKey + "&isSearch=" + isSearch+"'"); 

热点排行