|
capture the mouse down event of the item you want to drag around and save a handle to the element in the click handler (using the "this" pointer for example)
capture the mousemove and mouseup events of the document element and check to see if you have an element that is being dragged around (ie, the saved pointer isnt null) ... if so update it's position with the mouse until the mouseup event where you clear the dragged item handle
hth
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
I use IE6 and on a specific event the ajax request is sent and when response come back the function showTbl() is called. This function is:
function showTbl()
{
myTbl.innerHTML = SOAPResponse.xml;
}
the xml content is about 2000 rows like that:
<tr><td></td></tr>....
The object myTbl is a simple table element and is eventually shown, but it takes more than 30sec to insert the xml content to innerHTML.
How can I decrease this time?
Thank You
|
|
|
|
|
You're gonna need to give a better example. To the best of my knowledge, the innerHTML property on TABLE elements is read-only on IE6 - so i'm not sure what myTbl is in your code snippet. I ran the following test, and found the table generated almost instantly:
<html>
<head>
<script>
var tableHtml = "";
function init()
{
for (var i=0; i<2000; ++i)
tableHtml += "<tr><td>The quick brown foxes jumped</td></tr>";
}
function fillTable()
{
var tableDiv = document.getElementById("tableContainer");
tableDiv.innerHTML = "<table>"+tableHtml+"</table>";
}
function runTest()
{
init();
fillTable();
}
</script>
</head>
<body onload="runTest();">
<div id="tableContainer">
</div>
</body>
</html>
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
I'm sorry, saying myTbl I meant to div.
Here's better example.
<table id='tbl' border='0' cellpadding='2' style='font-family:David;'>
<thead align='center'>
<tr bgcolor='#5D7B9D' style='color:White;'>
<td>
<input id='btn' style='visibility:hidden;' onclick='undo(); return false;' src='undo.gif' type='image'/>
</td>
<td>Name</td>
<td>Id</td>
<td>Area</td>
<td>Status</td>
<td>Date</td>
<td>Time</td>
<td>Arrival</td>
<td>Comments</td>
<td></td>
</tr>
</thead>
<tbody align='center'>
<tr link1='1'>
<td>
<input type='image' title='edit' src='edit.png' callId='no_call' onclick='editCall(this); return false;'/>
</td>
<td style='cursor:hand;' rId='1234567' onclick='getDetails(this.rId, this.parentNode.rowIndex, true);'>Joe</td>
<td>1234567</td>
<td noarea='false'>99</td>
<td statusId='not_located'>Found</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
Assume that I have 2000 of rows like that with 'link1' in tbody. I build this code in server and as I explaind earlier I insert this code to div in client. But it takes about 30sec.
At first i built this code in cliend according to details I received with ajax but it took about 2minuts.
I hope, this time I explaint more claearly my problem/question.
Thank You,
|
|
|
|
|
HI,
I am using update panel in my application.but i am facing one issue.
I have one page for new enrolment of members, and i have two user controls Step1.ascx and Step2.ascx. My functionality is that at a time olny one control is visible on the page and other will be hide. for eg when user fills all fields in step1 and press next button then step2.acsx will be be visible true and user Step1.ascx will be visible false. all this happening at postback.
both control is under update panel to avaid post back during change of visibility.
On Step1.ascx i have one javascript variable var_pageName and its value is "Step1".
I want to update this value during post back to "Step2" when Step2 user control visible is true and vise versa. but the problem i am facing is javascript value is not updating during postback. I had tried this with scriptManager.RegisterClientScriptBlock and also with scriptManager.RegisterStartupScriptBlock by palacing it on both Usercontrol level and also on page level.
Please help as this is ver y urgent.
Sajid A.
|
|
|
|
|
I am working on soapextension that compresses soap message.
I am stuck at only one stage now. When I get response from webservice....on client at -BeforeDeserialize stage when I try to copy original or old stream to temp stream so that I can
de compress it, I get 'Stream dose not support seek operation' error.
Has any one come across smilar issue ...that while altering stream you could not capture it properly when client recieves it from server
debugging
This code will create new file for input and output each stage. You can see that till that point message is getting compressed and de compressed properly. Sort file by Date created
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.IO;
using System.IO.Compression;
using System.Xml;
using System.Threading;
namespace GZIPSoapExtension
{
public class GZIPSoapExtension : SoapExtension
{
protected Stream OriginalStream = null;
protected Stream NewStream = null;
protected String Mode = null;
public override object GetInitializer(Type WebServiceType)
{
return "C:\\" + WebServiceType.FullName + ".log";
}
public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute)
{
return null;
}
public override void Initialize(object initializer)
{
}
public override Stream ChainStream(Stream stream)
{
OriginalStream = stream;
NewStream = new MemoryStream();
return NewStream;
}
public override void ProcessMessage(SoapMessage message)
{
Mode = "";
switch (message.Stage)
{
case SoapMessageStage.BeforeSerialize:
Mode = "BeforeSerialize";
break;
case SoapMessageStage.AfterSerialize:
Mode = "AfterSerialize";
AfterSerializeHandler(message);
break;
case SoapMessageStage.BeforeDeserialize:
Mode = "BeforeDeserialize";
BeforeDeserializeHandler(message);
break;
case SoapMessageStage.AfterDeserialize:
Mode = "AfterDeserialize";
break;
}
}
public void BeforeDeserializeHandler(SoapMessage message)
{
WriteToLog("BeforeDeserializeHandler -- BeforeDecompress", message, OriginalStream);
Stream ms = new MemoryStream ();
Copy(OriginalStream, ms);
ms.Position = 0;
ms = DeCompressData(ms);
ms.Position = 0;
NewStream.Position = 0;
Copy(ms, NewStream);
ms.Position = 0;
NewStream.Position = 0;
WriteToLog("BeforeDeserializeHandler -- After Decompress", message, NewStream);
ms.Position = 0;
NewStream.Position = 0;
}
public void AfterSerializeHandler(SoapMessage message)
{
WriteToLog("AfterSerializeHandler -- before Compress" ,message, NewStream);
MemoryStream ms = new MemoryStream();
NewStream.Position = 0;
Copy(NewStream, ms);
NewStream.Position = 0;
ms.Position = 0;
ms= CompressData(ms);
ms.Position = 0;
NewStream.Position = 0;
Copy(ms, OriginalStream);
ms.Position = 0;
WriteToLog("AfterSerializeHandler -- After Compress", message, ms);
}
protected void Copy(Stream from, Stream to)
{
from.Position = 0;
int bytesRead;
byte[] buffer = new byte[2];
BinaryReader reader = new BinaryReader(from);
BinaryWriter writer = new BinaryWriter(to);
do
{
bytesRead = reader.Read(buffer, 0, buffer.Length);
writer.Write(buffer, 0, bytesRead);
} while (bytesRead > 0);
writer.Flush();
}
public MemoryStream CompressData(MemoryStream source)
{
if (source == null) return null;
MemoryStream ms = new MemoryStream();
GZipStream compressedzipStream = null;
try
{
byte[] buffer = new byte[source.Length];
source.Position = 0;
source.Read(buffer, 0, buffer.Length);
compressedzipStream = new GZipStream(ms, CompressionMode.Compress, true);
compressedzipStream.Write(buffer, 0, buffer.Length);
}
finally
{
compressedzipStream.Close();
}
return ms;
}
public MemoryStream DeCompressData(Stream s)
{
if (s == null) return null;
s.Position = 0;
GZipStream gs = new GZipStream(s, CompressionMode.Decompress);
BinaryReader reader = new BinaryReader(gs);
MemoryStream result = new MemoryStream();
BinaryWriter writer = new BinaryWriter(result);
int bytesRead;
byte[] buffer = new byte[2];
try
{
do
{
bytesRead = reader.Read(buffer, 0, buffer.Length);
writer.Write(buffer, 0, bytesRead);
} while (bytesRead > 0);
writer.Flush();
result.Position = 0;
}
finally
{
}
return result;
}
public void WriteToLog(String Source ,SoapMessage message, Stream s)
{
Thread.Sleep(1000);
int bytesRead;
String MsgType = null;
byte[] buffer = new byte[2];
if (message.GetType() == typeof(SoapServerMessage)) MsgType = "ServerMessage";
if (message.GetType() == typeof(SoapClientMessage)) MsgType = "ClientMessage";
//It logs message in new file. Just to make it easy to debug compressed message.
FileStream fs = new FileStream("C:\\" + MsgType + "-" + Source + "-" + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + ".txt", FileMode.Append, FileAccess.Write);
try
{
BinaryReader reader = new BinaryReader(s);
BinaryWriter writer = new BinaryWriter(fs);
do
{
bytesRead = reader.Read(buffer, 0, buffer.Length);
writer.Write(buffer, 0, bytesRead);
} while (bytesRead > 0);
writer.Flush();
}
finally
{
//if (swr != null) swr.Close();
if (fs != null) fs.Close();
}
}
}
[AttributeUsage(AttributeTargets.Method)]
public class GZIPSoapExtensionAttribute : SoapExtensionAttribute
{
private int _Priority = 1;
public override int Priority
{
get
{
return _Priority;
}
set
{
_Priority = value;
}
}
public override Type ExtensionType
{
get { return typeof(GZIPSoapExtension); }
}
}
}
kyus
|
|
|
|
|
I am getting a following error when i connect to a site.
"HTTP 407 Proxy Authentication Required - The ISA Server requires authorization to fulfill the request."
Its due to server authentication. Is it possibel to overcome this through code?
|
|
|
|
|
set the
obj.proxy = null;
|
|
|
|
|
im trying to develop a web project using vs2008 team edition ... other people on the project have a "new website" template for "ajax enabled web site" type thingy but i do not ... is there anything i need to do to get that option? (sacrifice a chicken, dance naked in the rain, go to church, etc etc)
thnx
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
Probably install the ASP.NET AJAX extensions.
However, you quite plainly do not need VS2008 to create ANYTHING on the project level to be able to use AJAX, you just need a project that imports that dll if you want to use the Microsoft AJAX enabled controls.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i just figured that out before your email arrived ... thnx christian
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
*grin*
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
l a u r e n wrote: m trying to develop a web project using vs2008 team edition
I thought you were an anti-microsofty linux type?
led mike
|
|
|
|
|
not anti-microsoft ... i grew up programming x86 and dos / windows and still do (well not dos so much anymore ) ... i just write and teach a lot of open source stuff these days and i do run linux most of the time because i prefer the ethos of it all ... right now i have a project in europe that requires asp.net so im using the tools for that job
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
l a u r e n wrote: right now i have a project in europe that requires asp.net so im using the tools for that job
Ah, that clears up a lot. Good luck on the project and have a great weekend. It's a 3 day holiday for use here in the US.
led mike
|
|
|
|
|
im in san francisco so its a 3 day holiday for me too (not that i get holidays much as a self employed worker) ... i just have a job from someone in europe
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
hi,
i am beginner to webservices.please help me on solving my problem.i have one webservice "clusterws" and i created one proxy class i want to test this proxy class using one webapplication to call the methods in my w
ebservice
please tell me the diferent ways to test proxy class with complete code.
thank u
madhavi.kona
|
|
|
|
|
HI, all
Hi If you feel its very simple plz let me know how its gonna work...
since its not a programming one, I am posting here...
I am preparing an appliction for which, I want to know hw the authentication(Basic and Access )will go under our WINDOW's authentication.,
and I want to test/know how HTTP Pipelining works in ASP.Net,
I have to prepare testcase document on this, Please help me,
Thanks,
Pashi
|
|
|
|
|
Hi all,
I need a suggestion to solve the below problem.
intXOffset = window.event.offsetX;
intYOffset = window.event.offsetY;
the above code works good in IE but not in any other browsers
how to write a browser independent javascript for this. Also there is a problem with this code. The function containing this code is called onLoad of the body and onclick of a image.
Also any one suggest me a URL from where i can learn browser independent javascript.
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
http://www.unix.com.ua/orelly/web/jscript/ch18_01.html
|
|
|
|
|
I want to know that what will be the server in case of server side javascript.
I know the code for that but my code is not running on IIS server.
If server is tomcat than what will be the structure of that folder, because in tomcat we must need web_inf .
|
|
|
|
|
Server side javascript ???
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
ummmmm javascript is client side ... runs in the browser
you mean server side java - servlets?
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
Classic ASP could do server-side Javascript. You don't want to use Classic ASP though. Trust me.
You could use Rhino[^] to run JS code on a server JVM, spitting out pages that way. Which sounds cool, but i've no experience with it and not too many other people do either, so prepare yourself for a lot of work getting things up and running.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
Greetings to all,
I have just recently used the ajax autocomplete and after an hour or so, I finally go it to work. However, I noticed that only the 1st char of the input text is case sensitive. How do I set the autocompete control in such a way that every char that the user types in is case sensitive.
E.G.
Presently, this is what happens:
DB table values = hello, Hello, hEllo, hELLO
User input = hEllo
autocomplete value = hello, Hello, hEllo, hELLO
I want it to be:
User input = hEllo
autocomplete value = hEllo, hELLO
|
|
|
|