我想動態更新gridview中按鈕的值到計數值。現在,我在「out.println("<td>" + "<input type = button id = getid onclick=getbuttonid() value = "<%=count%>" + ">" + "</td>");
我的目標是計數的值分配作爲按鍵值獲取未閉合的字符串文字錯誤。我到底做錯了什麼?JSP中未結束的字符串文字錯誤?
<tr>
<td colspan=4 align="center"
style="background-color:teal">
<b>User Record</b></td>
</tr>
<tr style="background-color:lightgrey;">
<td><b>Record Number: </b></td>
<td><b>Card Number: </b></td>
<td><b>MiddleName:</b></td>
<td><b>BankAccountID:</b></td>
<td><b>CurrencyID:</b></td>
<td><b>DayTransactionLimit:</b></td>
<td><b>Select:</b></td>
</tr>
<%
if(request.getParameter("mobilenumber")!=null)
{
FileReader fr = new FileReader(new File(("C:\\Users\\Farheen\\Documents\\NetBeansProjects\\Demo\\records.txt")));
BufferedReader br = new BufferedReader(fr);
String line = null;
int count =0;
// out.println("<table>");
while((line = br.readLine()) != null){
//out.print(line + "<br/>");
out.println("<tr>");
String[] data = line.split("\t");
for (String val : data) {
out.println("<td>" + val + "</td>");
count ++;
}
out.println("<td>" + "<input type = button id = getid onclick=getbuttonid() value = "<%=count%>" + ">" + "</td>");
out.println("</tr>");
}
// out.println("");
br.close();
}
%>
仍然顯示了同樣的錯誤。未結束的字符串文字。 – Farheen