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

  • Home
  • SEARCH
  • 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 9185773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:21:33+00:00 2026-06-17T19:21:33+00:00

I have the following aspx page: <%@ Page Language=C# AutoEventWireup=true CodeBehind=WebForm2.aspx.cs Inherits=KezberProjectManager.WebForm2 %> <!DOCTYPE

  • 0

I have the following aspx page:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="KezberProjectManager.WebForm2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<style>
h1 { padding: .2em; margin: 0; }
#products { float:left; width: 500px; margin-right: 2em; }
#cart { width: 200px; float: left; margin-top: 1em; }
/* style the list to maximize the droppable hitarea */
#cart ol { margin: 0; padding: 1em 0 1em 3em; }
</style>
<script>
    $(function () {
        $("#catalog").accordion();
        $("#catalog li").draggable({
            appendTo: "body",
            helper: "clone"
        });
        $("#cart ol").droppable({
            activeClass: "ui-state-default",
            hoverClass: "ui-state-hover",
            accept: ":not(.ui-sortable-helper)",
            drop: function (event, ui) {
                $(this).find(".placeholder").remove();
                $("<li></li>").text(ui.draggable.text()).appendTo(this);
            }
        }).sortable({
            items: "li:not(.placeholder)",
            sort: function () {
                // gets added unintentionally by droppable interacting with sortable
                // using connectWithSortable fixes this, but doesn't allow you to customize active/hoverClass options
                $(this).removeClass("ui-state-default");
            }
        });
    });
</script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <div id="products">
                <h1 class="ui-widget-header">Products</h1>
                <div id="catalog">
                    <h2><a href="#">T-Shirts</a></h2>
                    <div>
                        <ul>
                            <li>Lolcat Shirt</li>
                            <li>Cheezeburger Shirt</li>
                            <li>Buckit Shirt</li>
                        </ul>
                    </div>
                    <h2><a href="#">Bags</a></h2>
                    <div>
                        <ul>
                            <li>Zebra Striped</li>
                            <li>Black Leather</li>
                            <li>Alligator Leather</li>
                        </ul>
                    </div>
                    <h2><a href="#">Gadgets</a></h2>
                    <div>
                        <ul>
                            <li>iPhone</li>
                            <li>iPod</li>
                            <li>iPad</li>
                        </ul>
                    </div>
                </div>
            </div>
            <div id="cart">
                <h1 class="ui-widget-header">Shopping Cart</h1>
                <div class="ui-widget-content">
                    <ol>
                        <li class="placeholder">Add your items here</li>
                    </ol>
                </div>
            </div>

        </div>
    </form>
</body>
</html>

taken from http://jqueryui.com/droppable/#shopping-cart

I’m using asp .net. I’m wondering how I could modify this so that I could notify the server everytime I add an item and to be able to have some aspx code that is ran after I drop an item into my shopping cart.

What would I need to do to be able to have something like:

public partial class WebForm1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }  

     protected void Item_Dropped(String itemName)
    {
    }  
}

Essentially so that I could do something on the server like add this item to a database, without refreshing the page.

Are there any examples on how to do this sort of thing in asp .net?

Thanks

  • 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-17T19:21:34+00:00Added an answer on June 17, 2026 at 7:21 pm

    Take a look at this question – it will help you to understand how to implement javascript event when droping file on your page.

    When you have such event, then you just bind ajax call on this event and each time when this event fire sending ajax call to the server.

    It will not be asp.net request to server with all related stuff like transfering states, page reloading and so on, just a lightweight async call only with the data you need. If you want to have standard postback, call __doPostBack() javascript function which is generated by asp.net.

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

Sidebar

Related Questions

I have the following webform: <%@ Page Language=C# AutoEventWireup=true CodeBehind=Default.aspx.cs Inherits=TestWebApp.Default %> <!DOCTYPE html
I have following simple code: <%@ Page Language=C# AutoEventWireup=true CodeBehind=testForm.aspx.cs Inherits=Orbs.testForm %> <html> <body>
I have following Index.aspx web form: <%@ Page Language=C# AutoEventWireup=true CodeBehind=Index.aspx.cs Inherits=ProblematicWebApplication.Index %> <!DOCTYPE
I have the following aspx page: <%@ Page Language=C# AutoEventWireup=true CodeFile=index.aspx.cs Inherits=index %> <!DOCTYPE
I have some HTML, eg: <%@ Page Title=About Us Language=C# MasterPageFile=~/Site.master AutoEventWireup=true CodeBehind=ContentManagedTargetPage.aspx.cs Inherits=xxx.ContentManagedTargetPage
I have the following which works fine: <%@ Page Language=C# AutoEventWireup=true CodeFile=Default2.aspx.cs Inherits=test_library_newsletter_Default2 %>
In my default.aspx I have the following: <%@ Page Title=Home Page Language=C# MasterPageFile=~/Site.master AutoEventWireup=true
I have the following in an aspx page: <td colspan=2> <% DisplayParties(); %> </td>
I have following code. ASPX Page <a href=AnyASPXPageOfWebsite.aspx onclick=javascript:CallJQuery(); > Set Price </a> JS
Morning stackoverflow, I have a repeater, with the following code in my aspx page;

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.