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 6582595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:17:58+00:00 2026-05-25T16:17:58+00:00

I come from MVC background and I have little experience with web forms. I

  • 0

I come from MVC background and I have little experience with web forms.

I have established where the problem is, but so far I have been unable to fix this.

I have a form which is meant to execute Javascript function when body of the form loads. Please notice that head tag has a run at server attribute as it needs to use Request.QueryString.

The code is below:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    
<script type="text/javascript">

    function doSomething()
    {
        // Use web forms to do something
        var foo = <%= Request.QueryString["input"] %>;
    }
    
</script>
<title>Foo</title>
</head>
<body onload="doSomething()">
    <form id="MainForm" runat="server">
    <table width="272px" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td class="body">
                ...
            </td>
        </tr>
    </table>
    </form>
</body>
</html>

I get the following error:

SCRIPT5007: The value of the property doSomething is null or undefined, not a Function object.

My guess is that something executes on a server or other way round. This has worked previously (over a year ago), so potentially something in a web config was overwritten. I have spent the most of day on this and had no luck so far.

Edit: Generated output is below

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    
<script type="text/javascript">

    function doSomething()
    {
        debugger;                 
        var o = crmForm.queryString;    
    }
    
</script>


    <title></title>
</head>
<body onload="doSomething()">
    <form name="MainForm" method="post" action="fooPage.aspx?input=queryString" id="MainForm">
<div>
// hidden fields
    <table width="272px" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td class="body">
                // inputs
            </td>
        </tr>
    </table>
    


</form>
</body>
</html>
  • 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-25T16:17:59+00:00Added an answer on May 25, 2026 at 4:17 pm

    Instead of using the onload attribute of the body tag, you can also add the following code within the <script> tags:

    if(window.addEventListener) window.addEventListener("load", doSomething, true);
    else window.onload = doSomething;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I come from a Codeigniter MVC background that we've been working with for some
I have come from WPF (MVVM) background and trying to shift to MVC 2.
I come from classes object orientation languages and recently I have been learning those
I come from a web development background and haven't done anything significant in Java
I come from a JavaEE background and I am investigating what web frameworks exist
This maybe a stupid question but i've come from an asp.net background so reading
I come from an MVC background (Flex and Rails) and love the ideas of
I come from an ASP.NET MVC background and am currently going through the following
I come from heavy web application dev background, and having some problems representing my
I come from a Java background, where packages are used, not namespaces. I'm used

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.