Executing clientscript after asp.net method is executed ?

J

jesper_lofgren

Hello,

I have a problem, i have a event in asp.net codebehind file that
updating a datasource. If that update went well i want to refresh my
treeview thats on another page. The script works well, the problem
is.... the client script runs before the updatemethod !


I give u some ex code here...


aspx page


<script language="javascript" type="text/javascript">
function UpdateFieldTree()
{
parent.UpdateMenu();
}
</script>


<asp:Button ID="BtnAddCostCenter" Text="Lägg till" runat="server"
OnClick="AddData_Click" />


aspx.cs


protected void Page_Load(object sender, EventArgs e)
{
this.BtnAddCostCenter.Attributes.Add("onclick",
"javascript:parent.UpdateMenu();");



}


protected void AddData_Click(object sender, EventArgs e)
{

// Save list
jm.orderweb.formmanagement.ListManagement.SaveList(listObject);


// Now i want to run the javascript !!



}


Hope you have some ideas that can help me, this should not be some odd
case.

Thanks
Jeppe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top