ASP is not my forte...I am a Windows programmer by training. But I was asked to create an ASP application and have run into a problem. I have been searching for an answer and nothing I have found works for me.
I have a web page with two DIVs on it. They need to occupy the same place and I am using two radio buttons to control which is displayed. That all works fine.
After entering some info and hitting a Search button, the data is processed correctly, but during PostBack the default DIV (productselectiondiv) is visible again. If the user had selected the alternate DIV, I need that to be retained during PostBack.
I have tried Page.ClientScript.RegisterStartupScript() stuff, a hidden value field and javascript attached to the windows.onload and just can't get anythign working.
Here's what I think is relative code...This is unmodified from any of my trys. If you need more, please let me know. Any suggestions??? Thanks.
=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)
Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
I have a web page with two DIVs on it. They need to occupy the same place and I am using two radio buttons to control which is displayed. That all works fine.
After entering some info and hitting a Search button, the data is processed correctly, but during PostBack the default DIV (productselectiondiv) is visible again. If the user had selected the alternate DIV, I need that to be retained during PostBack.
I have tried Page.ClientScript.RegisterStartupScript() stuff, a hidden value field and javascript attached to the windows.onload and just can't get anythign working.
Here's what I think is relative code...This is unmodified from any of my trys. If you need more, please let me know. Any suggestions??? Thanks.
Code:
aspx.vb File
Page_Load
Me.rdbProducts.Attributes.Add("onclick", "showProducts()")
Me.rdbRetailers.Attributes.Add("onclick", "hideProducts()")
aspx File
<script type="text/javascript">
<!--
function showProducts() {
document.getElementById('productsselectiondiv').style.display = "block";
document.getElementById('retailersselectiondiv').style.display = "none";
}
function hideProducts() {
document.getElementById('productsselectiondiv').style.display = "none";
document.getElementById('retailersselectiondiv').style.display = "block";
}
// -->
</script>
=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)
Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer