&与& 转换问题 刚才说的不清楚结了换这张继续
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+'&selKind =&txtKey =&isSearch='" style="margin-top:6px;width:60px;">
为什么&变成了& 怎么解决
------解决方案--------------------& 前加 "\"
------解决方案--------------------没关系的,不影响使用
------解决方案--------------------改成:
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+"'");