473,385 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

dragging images

In ASP.NET, what technology would I use to drag images around the screen?
Once the dragging is over, I'd need to fire an event in my codebehind using
the x/y of the new placement of the image.
Nov 19 '05 #1
6 1140
That would be done using JavaScript and DHTML. You should be able to easily
Google the subject now that you know what to look for.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Chris Stewart" <Ch**********@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com...
In ASP.NET, what technology would I use to drag images around the screen?
Once the dragging is over, I'd need to fire an event in my codebehind
using
the x/y of the new placement of the image.

Nov 19 '05 #2
Yeah, we've currently been using all javascript in our application. We'd
like to start moving it to a managed environment. However, we need a way for
the javascript functions (mouse up, down, etc) to invoke an event in the .NET
codebehind letting us know when we can get the current x/y. We're having a
hard time figuring out how to do that. This is why I was hoping to do some
of the javascript stuff in .NET.

"Kevin Spencer" wrote:
That would be done using JavaScript and DHTML. You should be able to easily
Google the subject now that you know what to look for.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Chris Stewart" <Ch**********@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com...
In ASP.NET, what technology would I use to drag images around the screen?
Once the dragging is over, I'd need to fire an event in my codebehind
using
the x/y of the new placement of the image.


Nov 19 '05 #3
Hi Chris,

You don't really need to raise an event, unless you're working with a
Control. What you would need to do is use JavaScript to add information to a
hidden form field, POST the form back to the server, and read the hidden
form field on the server. Basically, it's the same mechanism as an event in
ASP.Net, but events are specifically associated with Controls.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Chris Stewart" <Ch**********@discussions.microsoft.com> wrote in message
news:81**********************************@microsof t.com...
Yeah, we've currently been using all javascript in our application. We'd
like to start moving it to a managed environment. However, we need a way
for
the javascript functions (mouse up, down, etc) to invoke an event in the
.NET
codebehind letting us know when we can get the current x/y. We're having
a
hard time figuring out how to do that. This is why I was hoping to do
some
of the javascript stuff in .NET.

"Kevin Spencer" wrote:
That would be done using JavaScript and DHTML. You should be able to
easily
Google the subject now that you know what to look for.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Chris Stewart" <Ch**********@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com...
> In ASP.NET, what technology would I use to drag images around the
> screen?
> Once the dragging is over, I'd need to fire an event in my codebehind
> using
> the x/y of the new placement of the image.


Nov 19 '05 #4
Well I am building server controls and I'm loading that javascript for. This
is a GIS application btw. So when a user drags the map image across the
screen (pan in the GIS world), that happens in javascript but I need my
control to know when that event is finished (mouse up) so I can get the new
coords and talk with the server for a new image. The same goes for zoom in,
zoom out, etc. We have all of the javascript code written as legacy, so
we're trying to find a way to make the ASP.NET server controls aware of when
these javascript events are firing and finishing.
"Kevin Spencer" wrote:
Hi Chris,

You don't really need to raise an event, unless you're working with a
Control. What you would need to do is use JavaScript to add information to a
hidden form field, POST the form back to the server, and read the hidden
form field on the server. Basically, it's the same mechanism as an event in
ASP.Net, but events are specifically associated with Controls.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Chris Stewart" <Ch**********@discussions.microsoft.com> wrote in message
news:81**********************************@microsof t.com...
Yeah, we've currently been using all javascript in our application. We'd
like to start moving it to a managed environment. However, we need a way
for
the javascript functions (mouse up, down, etc) to invoke an event in the
.NET
codebehind letting us know when we can get the current x/y. We're having
a
hard time figuring out how to do that. This is why I was hoping to do
some
of the javascript stuff in .NET.

"Kevin Spencer" wrote:
That would be done using JavaScript and DHTML. You should be able to
easily
Google the subject now that you know what to look for.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Chris Stewart" <Ch**********@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com...
> In ASP.NET, what technology would I use to drag images around the
> screen?
> Once the dragging is over, I'd need to fire an event in my codebehind
> using
> the x/y of the new placement of the image.


Nov 19 '05 #5
Chris,

In your javascript function to handle the ondrop event (or whatever
drag/drop event you need to trigger a postback), make a call the
javascript function

__doPostBack('mycontrolname','params');

passing the name of a valid (but probably hidden) control in the page
and any parameters you need to communicate to the application. In the
page, pick up your pseudo event with an event handler

Sub WindowChanged(ByVal obj As Object, ByVal e As EventArgs) Handles
mycontrolname.Click

Parameters you passed in 'params' will be found in
Request.Form("__EVENTARGUMENT").

This is another way of doing what Kevin was suggesting and is what
I've done in the past with drag/drop web applications.

Bill E.

Nov 19 '05 #6
Chris,

In your javascript function to handle the ondrop event (or whatever
drag/drop event you need to trigger a postback), make a call the
javascript function

__doPostBack('mycontrolname','params');

passing the name of a valid (but probably hidden) control in the page
and any parameters you need to communicate to the application. In the
page, pick up your pseudo event with an event handler

Sub WindowChanged(ByVal obj As Object, ByVal e As EventArgs) Handles
mycontrolname.Click

Parameters you passed in 'params' will be found in
Request.Form("__EVENTARGUMENT").

This is another way of doing what Kevin was suggesting and is what
I've done in the past with drag/drop web applications.

Bill E.

Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: joe | last post by:
I have an image database that I'd like to populate by dragging an image off the desktop and dropping onto a form (cut/paste would work equally as well) Any suggestions? Thanks, Joe
8
by: davefromalbury | last post by:
I'm trying to create a basic slider and I'm having absolutely no luck in firefox. Could someone please offer some hints as to what could be wrong? I think it's to do with the focus change upon...
2
by: bottarelli | last post by:
I am looking for a javascript solution to drag a series of images (along the horizontal axis only) within a fixed div to give the same drag effect of Google Maps. Here are the requirements: The...
2
by: Tull Clancey | last post by:
Does anyone have, or can anyone suggest a URL for code to drag a control around a form at run time? VB.Net 2003. I have written stuff in VB6 to do this before, but a long time ago and I don't...
2
by: louloizides | last post by:
I'm trying to drag a bunch of images in a Google maps-esque style. The javascript is pretty simple, but whenever I go and drag over a large image the image toolbar comes up in IE and the image...
1
by: bai | last post by:
Hi, I have some textboxes, combo box, images and table with data in an html. In the table I can sort the rows by dragging them. When I drag a row over textbox/image/label, the dragged object data is...
0
by: ravishankar Maduri | last post by:
Hi Freinds if any one knows how to disable the dragging of images to the address bar In my project i implemented the dragging feature by using the cropped images, its working finebut when we...
7
by: franki | last post by:
Hi all, Im trying to move several images together like with map engine - small pictures 200 width, 200 height displayed together without borders or padding create a map view. Im using Walter Zorn...
1
by: worldho | last post by:
Hi everyone. I develope GUI that processing images over a map. I used FloatCanvas and wxPython. I successed dragging images and successed to draw a map but failed to drag images over a map......
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.