I know there are a few hundred answers to questions like this on StackOverflow but I just am not 'getting it'.
I have a shopping cart in C# / asp.net. On a product page is a "Reserve" button. When the button is clicked the first time I want it to hide the product details panel (named ProdDet) and show the calendar panel. My challenges are:
I can not do it as an
OnClientClick
because I'm using anOnClick
to do other processing and can't get them both to behave together.I don't understand a lot of what I've read. I am fairly new to ASP.NET and C# and could use a little handholding.
There are several places in my code I'd like to use HidePanel and ShowPanel
My relevant pseudo-code (working and not):
Server-side:
public void CalendarButton_Click(object sender, EventArgs e)
{
some processing
if (everything ok) {
CalendarLiteral.Text += "<iframe...";
Hide_Panel(); // not working.
}
}
public void HidePanel()
{
Page.ClientScript.RegisterStartupScript(
...just not getting it or even sure this is the right thing to do.
);
}
Client-side in head section:
<script type="text/javascript">
function HideContent(d) {
document.getElementById(d).style.display = "none";
Alert("Hiding " + d);
}
</script>
It's not terribly bad but some of this server/client/.NET stuff is not easy to self-teach when coming from a straight C background. Any help is appreciated!