0
string rowString = "<tr id=\"row1\" bgcolor=\"#FFFFFF\" onMouseOver=\"this.bgColor='#EEEEEE';\" onMouseOut=\"this.bgColor='#FFFFFF';\" 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()));
嗨, 有人可以幫我找到上面的錯誤嗎? 我收到一個錯誤,因爲「輸入字符串不正確!」; 由於提前,stringbuilder中的錯誤
你應該叫'AppendFormat'。另外,你應該使用'@'字符串。此外,你有XSS洞。你應該使用模板引擎。 – SLaks 2010-03-21 15:14:28
同樣的事情發生,有輸入字符串,我不能看到sthg錯了! – Kubi 2010-03-21 15:15:43
我的意思是作爲一般性建議,而不是解決問題。 – SLaks 2010-03-21 15:16:03