Click here to Skip to main content
15,889,833 members
Articles / Web Development / ASP.NET

Partial Rendering Control using JQuery

Rate me:
Please Sign up or sign in to vote.
4.78/5 (8 votes)
5 Aug 2010CPOL8 min read 63K   734   45  
This article shows a web custom control that allows partial rendering using JQuery
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="JqueryController" Namespace="JqueryController" TagPrefix="cc1" %>

<%@ Register src="GridUserControl.ascx" tagname="GridUserControl" tagprefix="uc4" %>
<%@ Register src="DropDownListControl.ascx" tagname="DropDownListControl" tagprefix="uc5" %>
<!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>
    <script language="javascript">
        function showParams() {
            alert(showParams.arguments[0]);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <span>
       <cc1:JqueryController ID="JqueryControllerGrid" runat="server"  UserControlId="GridUserControl1"
            HorizontalAlign="Right" ContainersTriggers-Capacity="4" 
            ClientCallBackFunction="showParams">
           <uc4:GridUserControl ID="GridUserControl1" runat="server" />
                                  
        </cc1:JqueryController>
     </span>
     <span>
       <cc1:JqueryController ID="JqueryControllerDropDown" runat="server" UserControlId="DropDownListControl1"
            HorizontalAlign="Right" ContainersTriggers-Capacity="4">
           <uc5:DropDownListControl ID="DropDownListControl1" runat="server"/>
                                  
        </cc1:JqueryController>
     </span>
    </div>

       
                           
     
    <asp:button ID="Button1" runat="server" text="Add" OnClientClick="JqueryPost('default.aspx','action=add&');return false" />
     <asp:button ID="Button2" runat="server" text="Remove" OnClientClick="JqueryPost('default.aspx','action=remove&');return false" />
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect PeluSoft Limited
United Kingdom United Kingdom
I have been fascinated by software development since I was 10 years old. I'm proud of learned the first programming language with an Olivetti PC 128S based on Microsoft BASIC. I'm a Software Architect/Senior Developer with a strong background of all the developing Microsoft's technologies.

Comments and Discussions