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

window.open打开页面,同时传参数怎么传?

2012-01-07 
window.open打开页面,同时传参数如何传???e.Cell.Attributes.Add( onclick , window.open( schaddup.as

window.open打开页面,同时传参数如何传???
e.Cell.Attributes.Add( "onclick ", "window.open( 'schaddup.aspx ') "   );  


e.cell的意思是点击日历控件上的每一天的单元格,然后我想实现的是,打开页面后,能传个时间参数过去,就是在哪天上点击,就穿哪天。。。

结果应该是这样:
e.Cell.Attributes.Add( "onclick ", "window.open( 'schaddup.aspx?reurl=schedule.aspx&day= "   +   d.Date.ToShortDateString() ') "   );  


但是加上参数后页面就打不开了

[解决办法]
e.Cell.Attributes.Add( "onclick ", "window.open( 'schaddup.aspx?reurl= "+ Server.UrlEncode( "schedule.aspx ")+ "&day= " + Server.UrlEncode(d.Date.ToShortDateString())+ " ') " );
[解决办法]
都是引號問題,樓主注意配對

热点排行