944,156 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 6006
  • VB.NET RSS
Dec 20th, 2006
0

Drag and Drop

Expand Post »
Hi Guys,

I have an aspx page called Main.aspx which has several text boxes and a button.
When I click on this button, it opens up a popup window called SubMain.aspx

I want to drag and drop those text boxes from the Main.aspx page to this new popup window.

Is it possible in asp.net

Any code will be helpful, hopefully:cheesy:

Michael Ngobeni
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
michael.ngobeni is offline Offline
20 posts
since Dec 2006
Dec 21st, 2006
0

Re: Drag and Drop

Hi Guys,

I have an aspx page called Main.aspx which has several text boxes and a button.
When I click on this button, it opens up a popup window called SubMain.aspx

I want to drag and drop those text boxes from the Main.aspx page to this new popup window.

Is it possible in asp.net

Any code will be helpful, hopefully:cheesy:

Michael Ngobeni
Something like this ??


    '**************************************
    ' Name: Drag-and-Drop feature for Table 
    '     Rows
    ' Description:Simple code to allow drag-
    '     and-drop of records between 2 different 
    '     tables.
    ' By: ahWind
    '
    ' Assumes:Copy and paste the following c
    '     ode to an ASP Page. 
    To see the result, highlight a record from Table 1 Then drag over to Table 2 or vice-versa.
    '
    'This code is copyrighted and has    ' limited warranties.Please see http://w
    '     ww.Planet-Source-Code.com/vb/scripts/Sho
    '     wCode.asp?txtCodeId=7413&lngWId=4    'for details.    '**************************************
    
    <HTML>
    <BODY>
    <B><U>TABLE 1</U></B>
    <TABLE id="TABLE1" border=1>
    <% 
    For Row=1 To 4
    	Response.Write "<TR id='T1R" & Row & "' style='background-color:yellow' ondragstart='Javascript:FromCtrl=this' ondragover='fnClone(this)'>" 
    	For Col=1 To 3
    		Response.Write "<TD>T1R" & Row & "C" & Col & "</TD>"
    	Next
    	Response.Write "</TR>"
    Next
    %>
    </TABLE>
    <BR>
    <B><U>TABLE 2</U></B>
    <TABLE id="TABLE2" border=1>
    <% 
    For Row=1 To 4
    	Response.Write "<TR id='T2R" & Row & "' style='background-color:blue' ondragstart='Javascript:FromCtrl=this' ondragover='fnClone(this)'>" 
    	For Col=1 To 4
    		Response.Write "<TD>T2R" & Row & "C" & Col & "</TD>"
    	Next
    	Response.Write "</TR>"
    Next
    %>
    </TABLE>
    </BODY>
    </HTML>
    <SCRIPT>
    var FromCtrl 
    function fnClone(ToCtrl){	
    	if (FromCtrl != null) {
    		var FromTable	= FromCtrl.parentNode.parentNode
    		var ToTable		= ToCtrl.parentNode.parentNode
    		if (FromTable != ToTable) {
    			var NewRow		= ToTable.insertRow()						
    			var oCloneNode	= FromCtrl.cloneNode(true)
    			NewRow.swapNode(oCloneNode) 
    			
    			FromCtrl.removeNode(true)
    			FromCtrl = null
    		}
    	}
    }

</SCRIPT>
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003
Dec 21st, 2006
0

Re: Drag and Drop

Something like that.
I already had this code though.
This is one page. but I want to be able to drag from oen page to another.
I'm not too sure if this is possible on the browser.

Thanks for you help.
Click to Expand / Collapse  Quote originally posted by Paladine ...
Something like this ??

 
   '**************************************
    ' Name: Drag-and-Drop feature for Table 
    '     Rows
    ' Description:Simple code to allow drag-
    '     and-drop of records between 2 different 
    '     tables.
    ' By: ahWind
    '
    ' Assumes:Copy and paste the following c
    '     ode to an ASP Page. 
    To see the result, highlight a record from Table 1 Then drag over to Table 2 or vice-versa.
    '
    'This code is copyrighted and has    ' limited warranties.Please see http://w
    '     ww.Planet-Source-Code.com/vb/scripts/Sho
    '     wCode.asp?txtCodeId=7413&lngWId=4    'for details.    '**************************************
    
    <HTML>
    <BODY>
    <B><U>TABLE 1</U></B>
    <TABLE id="TABLE1" border=1>
    <% 
    For Row=1 To 4
        Response.Write "<TR id='T1R" & Row & "' style='background-color:yellow' ondragstart='javascript:FromCtrl=this' ondragover='fnClone(this)'>" 
        For Col=1 To 3
            Response.Write "<TD>T1R" & Row & "C" & Col & "</TD>"
        Next
        Response.Write "</TR>"
    Next
    %>
    </TABLE>
    <BR>
    <B><U>TABLE 2</U></B>
    <TABLE id="TABLE2" border=1>
    <% 
    For Row=1 To 4
        Response.Write "<TR id='T2R" & Row & "' style='background-color:blue' ondragstart='javascript:FromCtrl=this' ondragover='fnClone(this)'>" 
        For Col=1 To 4
            Response.Write "<TD>T2R" & Row & "C" & Col & "</TD>"
        Next
        Response.Write "</TR>"
    Next
    %>
    </TABLE>
    </BODY>
    </HTML>
    <SCRIPT>
    var FromCtrl 
    function fnClone(ToCtrl){    
        if (FromCtrl != null) {
            var FromTable    = FromCtrl.parentNode.parentNode
            var ToTable        = ToCtrl.parentNode.parentNode
            if (FromTable != ToTable) {
                var NewRow        = ToTable.insertRow()                        
                var oCloneNode    = FromCtrl.cloneNode(true)
                NewRow.swapNode(oCloneNode) 
 
                FromCtrl.removeNode(true)
                FromCtrl = null
            }
        }
    }

</SCRIPT>
Reputation Points: 10
Solved Threads: 0
Newbie Poster
michael.ngobeni is offline Offline
20 posts
since Dec 2006
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: a complete code & design for accounts based system
Next Thread in VB.NET Forum Timeline: Help Needed in choosing topic for contest





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC