|
|
i have a wen application using asp .net 2 and ajax extensions. I'm using ajax to show some text boxes when selecting items from combo box without refreshing the page. the code works normally on local machine, when uploading it to the hosting server i noticed that when selecting item from combo it take about 14 sec to show the text boxes.
how can i decrease the delay between Ajax request and response?or this delay is normal ?
|
|
|
|
|
Use a serverside solution.
For example, with JQuery, something like this:
<asp:DropDown ID="MyDropDown" runat="server"/>
<asp:TextBox ID="MyTextBox" runat="server"/>
<script type="text/javascript">
$(document).ready(function(){
$('<%=MyDropDown.ClientID%>').change(function(){
$('<%=MyTextBox.ClientID%>').val('<=MyDropDown.ClientID%').val());
});
})
</script>
Basically, once the page is loaded, you are binding a function to the change event on the drop down. The change event sets the value of the textbox using the value of the drop down.
It's a little more involved without JQuery, you would use $get() to reference the controls and have to iterate the drop down to get the selected value.
Jeremy Likness
http://csharperimage.jeremylikness.com/
|
|
|
|
|
I've wrote a basic ISAPI extension:
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { return TRUE; }
BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer) {
pVer->dwExtensionVersion = HSE_VERSION;
strncpy(pVer->lpszExtensionDesc, "UL Receiver", HSE_MAX_EXT_DLL_NAME_LEN);
return TRUE; }
DWORD WINAPI HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB) {
char * szStr = "<HTML><BODY>Hello, world!</BODY></HTML>";
DWORD dwBytes = sizeof(char) * strlen(szStr);
pECB->WriteClient(pECB->ConnID, szStr, &dwBytes, HSE_IO_SYNC);
return HSE_STATUS_SUCCESS; }
Next I made a form directed at the extension:
<html>
<body>
<form action="http://localhost/my.dll" method="post">
<input type="text" name="atextbox"><br>
<input type="checkbox" name="acheckbox"><br>
<input type="submit" name="Submit"><br>
</form>
</body>
</html>
If I access the extension directly, like: http://localhost/my.dll, it displays Hello, World! , as it should. But when I submit the form I get (null) 0 instead of Hello, World!
This is my first foray into ISAPI extensions, and I'm not sure what's going wrong or where to look next...
Can someone point me in the right direction, please ?
Any help is greatly appreciated! -MZR
|
|
|
|
|
if client don't have font that exist on server . So how to display that information on client with that font .
Sorry for my english !
|
|
|
|
|
The TTF file need to be on the system running only the web browser right? BTW, did you investigate into the feasibility of Unicode?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
hi every body
i want to know how can i stream videos from my server to client page
like youtube.com
can any body help me ???
|
|
|
|
|
to my knowldge , i think there is an ptin to paly audio video files using ActiveX Shell components..
sabarimd
|
|
|
|
|
I believe there is software that does it.
its a video/flash module that you can download. Having trouble remembering the name of it right now, sorry
|
|
|
|
|
Hi,
I have this code in JSP for Uploading multiple files :
This is the server side code snippet
<jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" >
<jsp:setProperty name="upBean" property="folderstore" value="F:/Program Files/CA/Unicenter Service Delivery/view/webapps/upload/Attach_doc"/>
</jsp:useBean>
<!-- <jsp:useBean id="bean" scope="page" class="javazoom.upload.attach" ></jsp:useBean> -->
<head>
<title>Samples : Simple Upload</title>
<style TYPE="text/css">
<!--
.style1 {
font-size: 12px;
font-family: Verdana;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body onload="parent.resizeTo('300','500'); moveTo(0,0);" background = 'background.JPG'>
<ul class="style1">
<%
String i1=request.getParameter("req");
out.println(i1);
int i2=Integer.parseInt(request.getParameter("role"));
%>
<%
if (MultipartFormDataRequest.isMultipartFormData(request))
{
MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);
String todo = null;
String userid="";
if (mrequest != null) { todo = mrequest.getParameter("todo"); userid = mrequest.getParameter("Userid");}
if ( (todo != null) && (todo.equalsIgnoreCase("upload")) )
{ try{
String filename="";
Hashtable files = mrequest.getFiles();
if ( (files != null) && (!files.isEmpty()) )
{
UploadFile file = (UploadFile) files.get("uploadfile");
file.setFileName(file.getFileName());
filename=file.getFileName();
if (file != null) out.println("<li>Form field : uploadfile"+"<BR> Uploaded file : "+file.getFileName()+" ("+file.getFileSize()+" bytes)"+"<BR> Content Type : "+file.getContentType());
upBean.store(mrequest, "uploadfile");
}
else
{
out.println("<li>No uploaded files");
}
This is the client side code snippet
<input type="hidden" name="todo" value="upload">
</td>
<td>
<input type="file" name="uploadfile" id="uploadfile" onchange="document.getElementById('moreUploadsLink').style.display = 'block';" />
<div id="moreUploads"></div>
<div id="moreUploadsLink" style="display:none;"><a href="javascript:addFileInput();">Attach another File</a></div>
<script>
var upload_number = 2;
var test="null";
function addFileInput() {
var d = document.createElement("div");
var file = document.createElement("input");
file.setAttribute("type", "file");
file.setAttribute("name", "uploadfile"+upload_number);
d.appendChild(file);
document.getElementById("moreUploads").appendChild(d);
upload_number++;
var test = upload_number;
}
</script>
Now when ever I am clicking on the upload button only the first file is getting uploaded. Please tell me what modification I need to do in the code to upload all the files attached.
Thanks in advance
|
|
|
|
|
Hi Folks,
I've recently experienced a major problem with a website I recently uploaded.
The problem is this......
I implemented a pretty standard thumbnail generation utility for uploaded images which works fine when tested on my local machine and also when I browse the website online from my local machine.
It doesn't work when I browse from other machines and also any thumbnails generated on the server when browsed from another machine do not show up on my machine!
I'm at a loss to explain this. Surely the code should be universal since it is processed by the server, not the local machine?
The only thing I can think of is that somehow the browser communicates with the server in a specific way based upon the installed framework that is on the browsing machine causing the server to run the code in a particular way. This goes against my understanding of the browser server relationship though.
My code is the following
<code>
''' <summary>
''' Resizes images to the specified size.
''' </summary>
''' <param name="fileStream">The file stream.</param>
''' <param name="fileName">Name of the file.</param>
''' <param name="finalPath">Where to save the resized image</param>
''' <param name="maxWidth">Maximum Width</param>
''' <param name="maxHeight">Maximum Height</param>
Public Shared Sub ResizeAndSave(ByVal fileStream As IO.FileStream, ByVal fileName As String, ByVal finalPath As String, ByVal maxWidth As Integer, ByVal maxHeight As Integer)
Using originalBMP As New System.Drawing.Bitmap(fileStream)
' Calculate the new image dimensions
Dim width As Integer = originalBMP.Width
'actual width
Dim height As Integer = originalBMP.Height
'actual height
'resize as landscape or portrait based on dimensions.
Dim tempWidth As Integer
If height > width Then
tempWidth = maxHeight
maxHeight = maxWidth
maxWidth = maxHeight
End If
Dim widthDiff As Integer = (width - maxWidth)
'how far off maxWidth?
Dim heightDiff As Integer = (height - maxHeight)
'how far off maxHeight?
'figure out which dimension is further outside the max size
Dim doWidthResize As Boolean = (maxWidth > 0 AndAlso width > maxWidth AndAlso widthDiff > -1 AndAlso (widthDiff > heightDiff OrElse maxHeight.Equals(0)))
Dim doHeightResize As Boolean = (maxHeight > 0 AndAlso height > maxHeight AndAlso heightDiff > -1 AndAlso (heightDiff > widthDiff OrElse maxWidth.Equals(0)))
'only resize if the image is bigger than the max or where image is square, and the diffs are the same
If doWidthResize OrElse doHeightResize OrElse (width.Equals(height) AndAlso widthDiff.Equals(heightDiff)) Then
Dim iStart As Integer
Dim divider As [Decimal]
If doWidthResize Then
iStart = width
divider = Math.Abs(CType(iStart, [Decimal]) / CType(maxWidth, [Decimal]))
width = maxWidth
height = CInt(Math.Round(CType((height / divider), [Decimal])))
Else
iStart = height
divider = Math.Abs(CType(iStart, [Decimal]) / CType(maxHeight, [Decimal]))
height = maxHeight
width = CInt(Math.Round(CType((width / divider), [Decimal])))
End If
End If
Using newBMP As New System.Drawing.Bitmap(originalBMP, width, height)
Using oGraphics As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(newBMP)
oGraphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias
oGraphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
oGraphics.DrawImage(originalBMP, 0, 0, width, height)
newBMP.Save(String.Format("{0}{1}x{2}_{3}", finalPath, maxWidth, maxHeight, fileName))
End Using
End Using
End Using
End Sub
</code>
I'm seriously considering wiping my machine and reinstalling thye operating system, visual studio et al to see if there are bugs in my copy of the Net framework. I'm running a Release Candidate of Windows 7 (daft I know) so I wonder if that is the issue.
Any help would be greatly appreciated.
Thanks in advance
JimBob SquarePants
*******************************************************************
"He took everything personally, including our royalties!"
David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager
*******************************************************************
|
|
|
|
|
Have you checked the compatibility mode settings on the browsers? I highly doubt that it is a bug in the framework
Also, you may want to review the How to get answers post at the top of this forum. "Cracking up" is not an appropriate or descriptive subject line.
only two letters away from being an asset
|
|
|
|
|
Changed.
Good point. It's been a long night and my brain's not what it should be.
I'm not saying that there's a bug in the framework. just that maybe somethings got corrupted on my computer. Even that's a shot in the dark.
JimBob SquarePants
*******************************************************************
"He took everything personally, including our royalties!"
David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager
*******************************************************************
|
|
|
|
|
Without going through all the code, the fact it works on your machine but not others suggests a couple of possible causes.
First, you may have something pointing to a local file, rather than a server version. Since the file exists on your machine, it will work, but not on others. Try renaming the folders you created the original web site in, and see if it still works.
A second possibility is that your thumbnail generation isn't working quite correctly, but having tested it on your mahine, you now have the required thumbnails in your cache, so they load OK. Try clearing your browser cache and trying again.
As mentioned above, it's unlikely to be a framework problem, so I'd view that as a last resort after checking more mundane causes.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Well..... A wee bit of a kip and a coffee later the answer was staring me in the face.
There was a bug in the thumbnail code. I wasn't passing the temporary variable Tempwidth down to MaxWidth so filenames weren't matching saved records.
I was also assigning the filepath for the images a static value rather than returning a dynamic value generated by landscape or portrait images.
I turned it into a function and returned the value back and that fixed everything.
Thanks to you both for your comments. It just takes a few sensible calm words to fix most problems.
Cheers!
JimBob SquarePants
*******************************************************************
"He took everything personally, including our royalties!"
David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager
*******************************************************************
|
|
|
|
|
Good morning Sir,
I would like to know about the ...
How to Develop game in C,...
Give basic idea withe example ...
Thanks,
Gopal Shah
|
|
|
|
|
if you like to develop a game in C, then this is wrong post, try in C forums.
Give more information, what type of game,which language etc...
Try this link
Game in C[^]
|
|
|
|
|
hi to all
any one can suggest that in which folder we can upload a file of the local file in filezila,as i upload a file in httpdocs and files are showing in the remote window but the web page is not looking on the internet.
please suggest me step by step
i am in very big trouble last 2 days i am doing only uploading but resut is 0
i am waiting ............
rizvan sivally
|
|
|
|
|
You need to read the documentation provided by your web hosting company, as they all have slightly different setups. Check their main web site for anything like a "Support", "Help", "FAQ" or "Forums" link, and look around there for instructions on which folders to use.
Also make sure you have the correct file extension - .htm or .html, and if you're not giving the full path to a file, that you have and index or home file.
If you're really stuck, email their support address, or raise a ticket in their support system, and they should get back to you with an explanation. Most hosting companies are fairly quick to respond (although it's now the weekend so you might have to be patient).
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
THANKS ALOT SIR
rizvan sivally
|
|
|
|
|
hi
can any body send to me calender show only mounth and year
thnx
|
|
|
|
|
On paper /php /javascript /asp ?
|
|
|
|
|
hi
can u write to me the address url plz
i'm new here
|
|
|
|
|
To what exactly?
I don't know what you want.
You haven't told us what language you are using.
|
|
|
|
|
i using php lang
but i want calender in javascript show only mounth and year wihtout dayes
thanx
|
|
|
|
|