My .aspx page contains a JavaScript function
<script type="text/javascript">
function openCity(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}</script>
Additionally, I have an ASP button
<asp:Button ID="Button2" runat="server" Text="submit" OnClick="Button2_Click" />
In the .aspx.cs page, I included this code
protected void Button2_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), System.Guid.NewGuid().ToString(), "openCity(event, 'Tokyo');", true);
}
Unfortunately, this implementation did not work as expected!