DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Posts
    16

    problem invoking a method in javascript from codebehind

    We have many transactions for eg:CashDeposit that are defined in xml eg:CashDeposit.xml.
    That XML is converted in to controls and placed in an usercontrol.
    While loading each Transaction we are loading an js file dynamically eg:CashDeposit.js for CashDeposit.

    This is the code for loading the Js file dynamically:

    string txnJS = "../ClientScripts/" + SessionManager.CurrentTransName + ".js";
    ScriptReference dynamicJS = new ScriptReference(txnJS);
    scrMain.Scripts.Add(dynamicJS);//scrMain is asp:ScriptManagerProxy

    then a method called ChkLoadBody() in the currentTransaction.js for eg:CashDeposit.js is invoked from the codebehind as:

    this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "OnLoad",
    "ChkLoadBody()", true);
    In this method we move some fields dynamically.

    The issue is while performing the transaction at first time we are able to load the transaction.js and we can able to invoke the ChkLoadBody() from js.
    But after performing the same transaction,when we try to execute the same at second time we cant able to invoke the ChkLoadBody() from js.
    how to resolve this issue?

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,649
    Quote Originally Posted by coimbatorian
    But after performing the same transaction,when we try to execute the same at second time we cant able to invoke the ChkLoadBody() from js.
    What happens when you try? Do you get errors? If so what?

    Or, are there no errors, but nothing happens?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Jun 2007
    Posts
    16
    There are no errors
    But it is not invoking the method in javascript
    even when the RegisterStartupscript statement is executed?

Similar Threads

  1. Replies: 0
    Last Post: 05-26-2007, 02:14 PM
  2. Replies: 0
    Last Post: 12-18-2006, 08:48 PM
  3. Replies: 0
    Last Post: 03-30-2002, 06:21 PM
  4. Please help w/ JavaScript & Netscape Problem
    By Dan Kurszewski in forum Web
    Replies: 0
    Last Post: 12-14-2000, 05:50 PM
  5. Sample Sites.
    By Murray Foxcroft in forum Web
    Replies: 5
    Last Post: 11-02-2000, 02:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links