There are actually two lines in the table, but I can only read one line from the HtmlTable control.
First, the aspx file has a table.
<table runat="server" id="datatable" border="1">
<tbody>
<tr>
<td>Name</td> Age>/td> Department>/td>Notes>/td>
</tr>
</tbody>
</table>
When loading the page, the server will add the data as follows:
HtmlTableRow=newHtmlTableRow();
// store data in row
datatable.Rows.Add(row);
The data is now displayed in two lines.
But at POST,
intn=datatable.Rows.Count;
If you get the number of lines in , you get a 1,
c# .net asp.net
It probably follows ASP.NET's specifications.If you add HtmlTableRow
in code behind, the previous data is not automatically restored.
The reason for this is that the information that the web browser sends to the server is limited to certain elements such as input
.Therefore, in ASP.NET, in order to save the WebControl
properties that output table
and span
, we output information called view state to restore properties in the early stages of the next request.However, the HtmlTable
is not intended for such behavior, so you do not restore rows from the view state.
A possible response is
GridView
HtmlTable
on each requestHtmlTable
state by entering and leaving the required information into and out of the ViewState
yourself
and so on.
597 GDB gets version error when attempting to debug with the Presense SDK (IDE)
577 PHP ssh2_scp_send fails to send files as intended
567 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
885 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.