I have an account settings page where the user can change the company name, admin password or main password. I am using javascript and links. When user click the "change admin password" link, the javascript code is called and the appropriate "div" is set to style.display=inline (otherwise its always style.display=none). After setting the password, the user clicks "Save Password" (a button). This causes a postback and so the visible "div" gets hidden.
I am trying to call a javascript function on page_load to check if the user was working on the admin password, it should display it i.e set style.display=inline... however i am unable to do that. The code i am using just gets called ONCE but not on every postback. Kindly help:
Here is my code for calling the javascript function on page_load
If (Not ClientScript.IsStartupScriptRegistered("viewdiv")) Then
Page.ClientScript.RegisterStartupScript _
(Me.GetType(), "viewdiv";, "view('divAdminPassword');", True)
End If
And my javascript function is:
function view(obj)
{
var div = document.getElementById(obj);
div.style.display = "inline";
}