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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:28:46+00:00 2026-06-14T05:28:46+00:00

ascx.cs protected string BindData() { List<Product> products = product.GetRepeaterData(prod); string json = JsonConvert.SerializeObject(products); return

  • 0

ascx.cs

protected string BindData()
   {
    List<Product> products = product.GetRepeaterData(prod);
    string json = JsonConvert.SerializeObject(products);
     return json;
   } 

ascx

 <script type="text/javascript" language="javascript">
function doSomething() {

    $.ajax({
        type: "POST",
        url: "/ProgramListSimple.aspx/BindData",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            alert(msg);
        }
    });
 };

I am not able to see any alert ..I dont know if the ajax function is doing what it is suppose to do..this code is for user control & not on the aspx page does that matter? while debugging I am able to see the serialized data in json string. Its just that its not rendering on the client side….working on it since morning now I need some help please..any examples or any doc can also be useful..

  • 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-06-14T05:28:47+00:00Added an answer on June 14, 2026 at 5:28 am

    I created a new aspx page. Transfered all the code behind logic to the aspx.cs from ascx.cs. The just called the url of the aspx page from my ascx page using ajax callback

            type: "GET",
            url:'<%=VirtualPathUtility.ToAbsolute("~/ProgramListSimpledetail.aspx") %>',
            data: dataObject,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (data) 
    

    I just added a small part of the fix that is very important for this to work other then this there were bunch of things that were added to make the ascx page inherit the properties from the apsx page…. but I think that was mainly related to my code…so I hope this helps someone in future…thanks for all those who tried to contribute..

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

Sidebar

Related Questions

I have a user control: <%@ Control Language=C# AutoEventWireup=true CodeBehind=Autocomplite.ascx.cs Inherits=Application.Controls.Autocomplite %> <script type=text/javascript
namespace KetBanBonPhuong.Controls.Default { public partial class SugFriends : System.Web.UI.UserControl { private string Uid; protected
I would like to call my Public String Function(...) method from my .ascx 's
I have this in my LoginControl.ascx code behind: protected void Logout_Click(object sender, EventArgs e)
My ascx control inside a container update panel does a full page refresh when
Because .ascx files are naturally rendered early in the page life cycle, if I
My .ascx is into folder /cms/context/ , and it is called Test.ascx (on .NET
I have an ascx that uses Eval in a repeater like this: <%@ Control
We have an ascx custom control (not a web part) hosted in a special
I have an .ascx control inside la page. In that control, I have a

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.