07-09-2009 06:18 AM
I want to call a java script function when ever user switches from one record to another record ( while in detail view). So i have written the code in the load event of the detail form(lets say leaddetail form). But the code is only executing on the entire page refresh(when i press F5)not on the every record switch(while in detail view).
So, Could any body please help me on this issue.
Thanks in Advance
Solved! Go to Solution.
07-11-2009 08:28 AM
I have got solution to this issue.The issue is On page load i am trying to dynamically populate the label by using C# code. But it doesn't worked. So i have tried to populate the the same using Java Script. It worked Fine. The below is the code i have used for that purpose.
string statevalue = "test"; ( Over here if we want any database field value we can get it by the statement "Sage.Entity.Interface.IAccount account1 = this.bindingsource.current as Sage.Entity.Interface.IAccount;", "statevalue = account1.userfield1;")
ScriptManager.RegisterClientScriptBlock ((Page)HttpContext.Current.Handler, HttpContext.Current.Handler.GetType(), "MyScript1", "document.all.getelementbyid(label1).innerHTML='Current Status: " + statevalue + "';", true);