Upload Progression Bar

liunx

Guest
Hi, does anybody have a clean, simple example of a upload progression bar. (really see the progress of the upload, not a "gif" file that says "uploading..."

Any help is appreciated!

I found some C# code that people claim to be working
(source: <!-- m --><a class="postlink" href="http://forums.whirlpool.net.au/forum-replies-archive.cfm/429576.html">http://forums.whirlpool.net.au/forum-re ... 29576.html</a><!-- m -->)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ClientCallback.aspx.cs" * Inherits="ClientCallback" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/* xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtm* l" >
<head id="Head1" runat="server">
<title>Callback Test</title>
<script type="text/javascript">
function ReceiveServerData(receivedStr, context)
{
alert(receivedStr);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="button" value="Callback" onclick="CallServer('argument', 'context')"/><br />
</form>
</body>
</html>

-------- ClientCallbacp.aspx.cs -----------
// ClientCallback.aspx.cs code-behind page
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;*
using System.Web.UI.HtmlControls;

public partial class ClientCallback : System.Web.UI.Page, System.Web.UI.ICallbackEventHandle* r
{

void Page_Load(object sender, EventArgs e)
{
ClientScriptManager cm = Page.ClientScript;
String cbReference = cm.GetCallbackEventReference(this,* "arg", "ReceiveServerData", "");
String callbackScript = "function CallServer(arg, context) {" + cbReference + "; }";
cm.RegisterClientScriptBlock(this.* GetType(), "CallServer", callbackScript, true);
}

private string returnStr;
//function called by client, executed on server
public void RaiseCallbackEvent(String eventArgument)
{
//do something with return argument
returnStr = eventArgument.ToUpper();
return;
}

//function that sends result?
public string GetCallbackResult()
{
return returnStr;
}
}

I tried to convert it myself into VB.net:

it does not work .. :(



Imports System.Data
Imports System.Configuration
Imports System.Collections
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI

Partial Class test
Inherits System.Web.UI.Page
Public returnStr As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim cm As ClientScriptManager = Page.ClientScript
Dim cbReference As String = cm.GetCallbackEventReference(Me, -"arg", "ReceiveServerData", "")
Dim callbackScript = "function CallServer(arg, context) {" + cbReference + "; }"
cm.RegisterClientScriptBlock(Me.[GetType](), "CallServer", callbackScript, True)
End Sub
Public Sub RaiseCallbackEvent(ByVal eventArgument As String)
returnStr = eventArgument.ToUpper
Return
End Sub
Public Sub GetCallbackResult(ByVal returnStr As String)
Return
End Sub
End ClassFound my solution

This article is in C# tough, simply converted it to vb.net
<!-- m --><a class="postlink" href="http://www.c-sharpcorner.com/UploadFile/munnamax/ProgressBar07062007122251PM/ProgressBar.aspx">http://www.c-sharpcorner.com/UploadFile ... ssBar.aspx</a><!-- m -->
 
Back
Top