怎么向字符串中传参? 如题,就是在后台为dropdownlist添加属性,然后str是个字符串,droplist.Attributes.Add("onchange", "nextdrop1(this.options[this.selectedIndex].value,str");里面那个str应该怎么写,这样写似乎不行,谢谢解答 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 "str"根据你的需求定义这个参数了,给它赋值了. 本帖最后由 caozhy 于 2011-05-02 23:20:57 编辑 droplist.Attributes.Add("onchange", "nextdrop1(this.options[this.selectedIndex].value,'"+str+'"); 额lz的写法多少有点儿惨不忍睹为droplist添加onchange事件,不管怎么说nextdrop1()的括号好歹也要是“一对”吧^_^!string str = "Str";this.dropdownlist.Attributes.Add("onchange", "nextdrop1(this.options[this.selectedIndex].value,'" + str + "')");很常用的拼接方式,可以对比一下sql语句的拼接,比较容易理解 droplist.Attributes.Add("onchange", "nextdrop1(this.options[this.selectedIndex].value,'"+str+'"); 面试题求教---文件迁移 CS安装部署的一个问题 如果编一个多线程的程序用c#好还是vb.net 好 大家推荐一下C#网络编程方面的书籍、教程啊 SetComputerNameEx 修改计算机名后登陆到联创 NET 打包命令。。 xml节点搜索问题 listbox两级联动,listbox2无法绑定 求大神帮忙改个错误 .net的 有点复杂的 替换函数 C#打印DataGridView 值类型和引用类型,堆栈和堆的疑问?
为droplist添加onchange事件,不管怎么说nextdrop1()的括号好歹也要是“一对”吧^_^!
string str = "Str";
this.dropdownlist.Attributes.Add("onchange", "nextdrop1(this.options[this.selectedIndex].value,'" + str + "')");很常用的拼接方式,可以对比一下sql语句的拼接,比较容易理解
droplist.Attributes.Add("onchange", "nextdrop1(this.options[this.selectedIndex].value,'"+str+'");