日期:2014-05-18  浏览次数:20474 次

&与&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+"'");