请看:http://search.csdn.net/Expert/topic/2001/2001793.xml?temp=.8257257
这里面mynewpc(水中日月) 提到
你是用的url传值,user.aspx?val=v1&val1=v2&val2=v3,这样不就行了.我这样写为什么就出现脚本错误
this.Button1.Attributes.Add("onclick","var st=window.showModalDialog('GuestWord.aspx?val='+document.all('txtweb').value&vall='+document.all('txtname').value)");而我把&后面去掉
this.Button1.Attributes.Add("onclick","var st=window.showModalDialog('GuestWord.aspx?val='+document.all('txtweb').value)");却是对的,不知道为什么??

解决方案 »

  1.   

    顺便在问下我要把txtweb,txtname,type传到下个页面,其中type是常量,正确的写怎么样??
      

  2.   

    his.Button1.Attributes.Add("onclick","var st=window.showModalDialog('GuestWord.aspx?val='+document.all('txtweb').value+'&vall='+document.all('txtname').value+")");
      

  3.   

    this.Button1.Attributes.Add("onclick","var st=window.showModalDialog('GuestWord.aspx?val='+document.all('txtweb').value+'&vall='+document.all('txtname').value)");
    注意你在引号里面的参数传递!
      

  4.   

    his.Button1.Attributes.Add("onclick","var st=window.showModalDialog('GuestWord.aspx?val='+document.all('txtweb').value+'&vall='+document.all('txtname').value+")");注意这里:
    +'&vall='+
      

  5.   

    你的单引号位置错了,看一下seesea125
    his.Button1.Attributes.Add("onclick","var st=window.showModalDialog('GuestWord.aspx?val='+document.all('txtweb').value+'&vall='+document.all('txtname').value+")");