开发者

the error in the stringbuilder

    string rowString = "<tr id=\"row1\" bgcolor=\"#FFFFFF\" onMouseOver=\"this.bgColor='#EEEEEE';\" onMouseOut=\"this.bgColor='#FFFFF开发者_高级运维F';\" style=\"cursor:pointer;\">" +
        "<td bgcolor=\"#FFFFFF\"><img src=\"images/"+"-companylogofilename-"+"\" width=\"108\" height=\"32\" alt=\""+"-companyname-"+"\" /></td>" + //turkish.airlines.jpg airlineiconfilename, airline name 
    "<td class=\"table_content\">{0}</td>" +
    "<td class=\"table_content\">{1}</td>" +
    "<td class=\"table_content\">{2}</td>" +
    "<td class=\"table_content\">{3}</td>" +
    "<td class=\"table_content\">{4}</td>" +
    "<td class=\"table_content\"><table width=\"98%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" +
    "<tr><td class=\"table_content\">{5}</td>" +
    "<td width=\"20\" align=\"right\">" +
    "<a href=\"default.aspx\" onClick=\"return hs.htmlExpand(this, { headingText: '{6} - {7}', width: 600, height: 215, targetX: 'row1 400px', targetY: 'row1 40px' })\">" +
    "<img src=\"images/arrow.png\" width=\"13\" height=\"16\" border=\"0\" class=\"tip\" onMouseOver=\"tooltip('Click for Details.');\" onMouseOut=\"exit();\" />" +
    "</a>";

    accordionHTML.Append(String.Format(rowString,
        flight.Get_AirlineCode(),
        flight.Get_Clase(),
        flight.Get_Departure(),
        flight.Get_DeprtDate(),
        flight.Get_DeprtTime(),
        flight.Get_Destination(),
        flight.Get_Departure(),
        flight.Get_Destination()));

Hi, Can someone please help me to find the mistake above ? I am getting an error as "Input string was not correct !"; Thanks in advance,


Your inline onClick handler has unescaped standalone braces in the object literal:

onClick=\"return hs.htmlExpand(this, { headingText: '{6} - {7}', width: 600, height: 215, targetX: 'row1 400px', targetY: 'row1 40px' })\">"

You need to write this, {{ headingText... }}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜