, , FileUpload. , , ODBC ( ajax script).
, CSS ( : http://css-tricks.com/examples/ProgressBars/).
script ( -) , :
.asmx - :
[WebMethod]
public int GetStatus()
{
int progress = 0;
return progress;
}
aspx - :
<asp:ScriptManager runat="server" ID="ScriptManager">
<Services>
<asp:ServiceReference Path="~/services/import.asmx" InlineScript="false" />
</Services>
</asp:ScriptManager>
JavaScript ( , , setTimeout), JavaScript jQuery:
var tout, service;
function UpdateStatus() {
if (tout != null)
clearTimeout(tout);
if (service == null)
service = new namespace.here.serice_class_here();
service.GetStatus(onSuccess, onFailure);
}
function onSuccess(result) {
progress_bar.style.width = percent + "%";
tout = setTimeout("UpdateStatus()", 1000);
}
function onFailure(error) {
alert(error.get_message());
}
JavaScript onSuccess ( 100%), .
, !