Click here to Skip to main content
15,891,136 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionPaypal Integration Pin
gautamamit828-Aug-10 2:16
gautamamit828-Aug-10 2:16 
AnswerRe: Paypal Integration Pin
dan!sh 28-Aug-10 4:02
professional dan!sh 28-Aug-10 4:02 
AnswerRe: Paypal Integration Pin
raju melveetilpurayil28-Aug-10 12:25
professionalraju melveetilpurayil28-Aug-10 12:25 
QuestionClass definition [modified] Pin
future383928-Aug-10 1:42
future383928-Aug-10 1:42 
AnswerRe: Class definition [modified] Pin
dan!sh 28-Aug-10 4:00
professional dan!sh 28-Aug-10 4:00 
AnswerRe: Class definition Pin
Yusuf28-Aug-10 4:54
Yusuf28-Aug-10 4:54 
AnswerRe: Class definition Pin
Not Active28-Aug-10 11:31
mentorNot Active28-Aug-10 11:31 
QuestionJQuery not working in user control [modified] Pin
afsal qureshi27-Aug-10 23:52
afsal qureshi27-Aug-10 23:52 
Hi,

I am just trying to learn JQuery.
I want to try out a basic JQuery example. Adding items from one list box to another.
It works fine in the normal aspx page (I pasted it in Default.aspx in root directory).

I placed JQuery Libraries in a folder Javascript under root.

This works fine.

Then I created a WebUserControl and placed the same code and I registerd this user control in default.aspx.
The page loads , but when I click on Add it does not move items from one list to another.

While in the aspx page, I checked the Watch and
innerHTML of the context->childNodes has values "Delhi, Bombai ..........". Same as OuterHTML.

But in the user control with the same code as pasted below.

innerHTML is "" and OuterHTML is "<HTML4F>"


Please throw some light to this

See the code below:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="User_Controls_WebUserControl" %>

&nbsp;&nbsp;&nbsp; <!--Add JQuery reference -->
    <script src="../Javascript/jquery-1.4.1.js" type="text/javascript"></script>
    
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            debugger;
            //If you want to move selected item from fromListBox to toListBox
            $("#add").click(function () {
                debugger;
                $("#fromListBox  option:selected").appendTo("#toListBox");
            });
            //If you want to move all item from fromListBox to toListBox
            $("#addAll").click(function () {
                $("#fromListBox option").appendTo("#toListBox");
            });
            //If you want to remove selected item from toListBox to fromListBox
            $("#remove").click(function () {
                $("#toListBox option:selected").appendTo("#fromListBox");
            });
            //If you want to remove all items from toListBox to fromListBox
            $("#removeAll").click(function () {
                $("#toListBox option").appendTo("#fromListBox");
            });

        });
</script>


  <table>
  <tr>
  <td><asp:ListBox ID="fromListBox" runat="server" SelectionMode="Multiple" Rows="6">
            <asp:ListItem>Delhi</asp:ListItem>
            <asp:ListItem>Chennai</asp:ListItem>
            <asp:ListItem>Pune</asp:ListItem>
             <asp:ListItem>Kolkata</asp:ListItem>
             <asp:ListItem>Mumbai</asp:ListItem>
             <asp:ListItem>Bangalore</asp:ListItem>
        </asp:ListBox></td>
  <td> <input id="add" type="button" value="Add" /><br/>
        <input id="addAll" type="button" value="Add All" /><br/>
        <input id="remove" type="button" value="Remove" /><br/>
        <input id="removeAll"type="button" value="Remove All" /><br/></td>
  <td><asp:ListBox ID="toListBox" runat="server" SelectionMode="Multiple" Rows="6"></asp:ListBox>  </td>
  </tr>
  </table>


modified on Saturday, August 28, 2010 6:03 AM

AnswerRe: JQuery not working in user control Pin
Abhijit Jana28-Aug-10 0:01
professionalAbhijit Jana28-Aug-10 0:01 
GeneralRe: JQuery not working in user control [modified] Pin
afsal qureshi28-Aug-10 0:16
afsal qureshi28-Aug-10 0:16 
AnswerRe: JQuery not working in user control Pin
Not Active28-Aug-10 11:38
mentorNot Active28-Aug-10 11:38 
Questiondisable or remove minimize and maximize buttons in a startupwindow Pin
vishnukamath27-Aug-10 21:30
vishnukamath27-Aug-10 21:30 
AnswerRe: disable or remove minimize and maximize buttons in a startupwindow Pin
Abhijit Jana27-Aug-10 23:59
professionalAbhijit Jana27-Aug-10 23:59 
GeneralRe: disable or remove minimize and maximize buttons in a startupwindow Pin
vishnukamath30-Aug-10 3:57
vishnukamath30-Aug-10 3:57 
AnswerRe: disable or remove minimize and maximize buttons in a startupwindow Pin
cramteke30-Aug-10 0:11
cramteke30-Aug-10 0:11 
GeneralRe: disable or remove minimize and maximize buttons in a startupwindow Pin
vishnukamath30-Aug-10 4:11
vishnukamath30-Aug-10 4:11 
GeneralRe: disable or remove minimize and maximize buttons in a startupwindow Pin
cramteke30-Aug-10 21:58
cramteke30-Aug-10 21:58 
QuestionGet File Name from fileupload templatefeild control in gridview Pin
vishnukamath27-Aug-10 2:43
vishnukamath27-Aug-10 2:43 
AnswerRe: Get File Name from fileupload templatefeild control in gridview Pin
Ankur\m/27-Aug-10 3:24
professionalAnkur\m/27-Aug-10 3:24 
AnswerRe: Get File Name from fileupload templatefeild control in gridview Pin
Abhijit Jana27-Aug-10 17:34
professionalAbhijit Jana27-Aug-10 17:34 
GeneralRe: Get File Name from fileupload templatefeild control in gridview Pin
vishnukamath30-Aug-10 3:44
vishnukamath30-Aug-10 3:44 
Questionconverting byte array to string format Pin
Amit Patel198526-Aug-10 21:27
Amit Patel198526-Aug-10 21:27 
AnswerRe: converting byte array to string format Pin
dan!sh 26-Aug-10 22:35
professional dan!sh 26-Aug-10 22:35 
AnswerRe: converting byte array to string format Pin
T M Gray27-Aug-10 8:30
T M Gray27-Aug-10 8:30 
QuestionCannot use a leading .. to exit above the top directory Pin
Member 426027026-Aug-10 21:12
Member 426027026-Aug-10 21:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.