0

StringBuilder を使用してテーブルを表示しようとしましたが、うまくいきません。sb.Append(string.Format()で「オブジェクト参照がオブジェクトのインスタンスに設定されていません」というエラーが発生します。助けてください。ありがとう。

            foreach (Item item in list)
            {

                sb.Append(string.Format(
                    @"<table >
                        <tr>
                            <th rowspan ='6' width='150px'><img runat='server' src='{3}'/>
                            </th>
                            <th width='50px'>Title: </th>
                            <td>{0}</td>
                        </tr>
                        <tr>
                            <th>Price:</th>
                            <td>{1}</td>
                        </tr>
                        <tr>
                            <th>Available: </th>
                            <td>{2}</td>                                
                        </tr>
                    </table>",  item.ItemAttributes.Publisher,item.ItemAttributes.ListPrice.ToString(), item.ItemAttributes.NumberOfItems, item.SmallImage.URL));
                lblItemResponse.Text = sb.ToString();


            }
4

0 に答える 0