Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6353309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:23:18+00:00 2026-05-24T22:23:18+00:00

I have an aspx page associated with master page. In aspx.cs file I tried

  • 0

I have an aspx page associated with master page. In aspx.cs file I tried to call a JavaScript function using following code

//Code behind (aspx.cs)

ClientScript.RegisterClientScriptBlock(Page.GetType(), "javascript", "GetCmpValue()", true);

//aspx page 
<%@ Page Language="C#" MasterPageFile="~/mlayout.Master" AutoEventWireup="true"          CodeBehind="MResults.aspx.cs" Inherits="Predict.MResults" Title="Untitled Page" %>
 //javascript function
 <script type="text/javascript" language="javascript">
   function GetCmpValue()
   {
     var CmpId=$find('bidLoc');
   } 


</script> 

I am receiving an error Microsoft jscript runtime error object expected issue when page run in IE, but in Firefox and chrome you didn’t find error message but still there is problem in calling JavaScript function. Could any one help me in resolving this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:23:19+00:00Added an answer on May 24, 2026 at 10:23 pm

    Assuming that your page is located in a subfolder of your root and this function would work for pages in the root directory.

    Add the path to jQuery as ScriptReference to your ScriptManager/ToolkitScriptManager.

    For example:

    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Scripts>
           <asp:ScriptReference Path="~/jQuery/js/jquery-1.5.1.min.js" />
           <asp:ScriptReference Path="~/jQuery/js/jquery-ui-1.8.10.custom.min.js" />
        </Scripts>
    </asp:ScriptManager>
    

    Here you can use the Tilde(~) to resolve the correct path to your script(from the root-directory).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have taken three textboxes over aspx page. A JavaScript function is associated with
I have aspx page where there is no code behind. Server side Code written
I have an ASPX page (On server A) which is invoked using NTLM credentials.
I have an aspx page title tag like the following : <title> XXXX-content page
I have a DropDownList that is associated with a DataSource in the aspx page.
I have a Page that is associated with a master page. In the master
I have a page and a user control — we'll call them Detail.aspx and
I have an aspx page that uses a master page. On this page I
I have an aspx page which has the following: A repeater with a linkbutton
I have an aspx page which contains a repeater. I can output data using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.