For example, right now I have my ASPX like so:
<form name="form" runat="server" onsubmit="validate(this)">
<table width="100%" height="100%">
<tr>
<td class="label">
Start Date:
</td>
<td>
<input type="text" name="StartDate" value='<%=GetCurrentDate("- testParam")%>' maxlength="10" />
</td>
</tr>
</table>
</form>
..and my C# as follows:
public static string GetCurrentDate(string str)
{
return DateTime.Now.ToString("MM/dd/yyyy") + str;
}
This works fine and outputs "03/08/2017 - testParam". But what if, for example, instead of sending a hardcoded string manually as I did above, I want to pass in one of the HTML element's values as a parameter from the ASPX side? Like this:
...
<tr>
<td class="label">
Start Date:
</td>
<td>
<input type="text" name="StartDate" value="<%=GetCurrentDate(formObj.elements.item('someLabel').value)%>" maxlength="10" />
</td>
</tr>
...
What do I need to do to get the "someLabel" element's value on my ASPX page to the C# page? Any help with this will be greatly appreciated.
