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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:24:33+00:00 2026-05-28T16:24:33+00:00

I have a scrollable GridView in my Web Part and I have to make

  • 0

I have a scrollable GridView in my Web Part and I have to make an AJAX call on each user scroll. I use Jquery 1.7.1 in the web part to call a c# handler class.

I am getting error 500 : Internal Server Error.

Here is a sample of the ascx :

<div id="divProducts" style="height:300px;overflow:auto">
    <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" EnableViewState="false">
        <AlternatingRowStyle BackColor="White" />
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle CssClass="header" BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
    </asp:GridView>
</div>

<div id="divProgress" style="margin-top: -50px;margin-left:150px;z-index:-999">
    <asp:Image ID="image1" ImageUrl="~/_layouts/images/MyWebPart/loading.gif" width="100" height="100" runat="server" />
</div>

<script type="text/javascript">
    $(document).ready(function () {

        //initially hide the loading gif
        $("#divProgress").hide();

        //Attach function to the scroll event of the div
        $("#divProducts").scroll(function () {

            //User has scrolled to the end of the grid. Load new data..
            $("#divProgress").ajaxStart(function () {
                $(this).show();
            });
            $("#divProgress").ajaxStop(function () {
                $(this).hide();
            });

            BindNewData();

        });

    });

    function BindNewData() {
            $.ajax({
                type: "GET",
                url: "/_layouts/MyWebPart/FetchRecordsHandler.ashx",
                success: function (data) {
                    alert('data ', data);
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert(xhr.status);
                    alert(thrownError);
                }  
            });
        }
</script>

I added a ASHX file that will be deployed in Layouts folder of my web part project (Layouts/MyWebPart/FetchRecordsHandler.ashx) :

<%@ WebHandler Language="C#" Class="MyWebPart.Code.FetchRecordsHandler" CodeBehind="FetchRecordsHandler.cs" %>

And I created the class FetchRecordsHandler that implements IHttpHandler with correct namespace :

namespace MyWebPart.Code
{
    class FetchRecordsHandler : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {

            context.Response.Write("From the handler at " + DateTime.Now);

        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

This method doesn’t work in my web part. Any idea of a solution or maybe another technic to make ajax calls from the scroll events to the web part ?

Thx

  • 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-28T16:24:35+00:00Added an answer on May 28, 2026 at 4:24 pm

    You need to change your .ashx to something like:

    <%@ WebHandler Language="C#" Class="MyWebPart.Code.FetchRecordsHandler, {my assembly}, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx" %>
    

    Where {my assembly} is the name of the compiled .dll (without the .dll), probably MyWebPart and xxxxxxxxxxxxxxxx is the public key token for your assembly. One way to find this would be to look at the deployed .ascx from your web part, the first line or so should contain something similar.

    I imagine the 500 error you are receiving has something to do with the fact that SharePoint cannot load the assembly for your .ashx. You could look in the event viewer for more details.

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

Sidebar

Related Questions

I have this jQuery function function getData(jsonLink){ $(.scrollable .items).html(<img class='loadGif' src='/sites/all/themes/zen/journeyon/images/ajax-loader.gif' alt='' />); $.ajaxSetup({
I have a scrollable div tag (overflow). Now I'd like to use mouse to
When creating scrollable user controls with .NET and WinForms I have repeatedly encountered situations
I am using the jQuery Tools Scrollable plugin - http://flowplayer.org/tools/scrollable.html#navigator I have created a
What I'm trying to achieve is a scrollable tab-bar. I have a web page
I have a jquery scrollable that is not constrained to be within it's parent.
I have a treeview with a fixed size. How can i make it scrollable
I have only one list div and I want to make it scrollable. I
I have to make an iframe element from java script so it isn't scrollable
I have set of textboxes in a gridview and I use the Focus() method

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.