.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Asad Ali
Fauzul Azmi
Post New Web Links

AJAX AsyncFileUpload and session mode="stateserver"

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net
 

hi, I need tu upload files to a webserver from an asp.net web application, I considered to choises asp:uploadfile or  AJAX AsyncFileUpload.

 

asp:uploadfile needs a fullpostback to work, I cant do a fullpostback on my page.

AJAX AsyncFileUpload, in this case the problem is that i'm using sessionstate mode="stateserver" and teh httppostedfile can't nor bee serialized.

 

is there any solution to this contradiction?, is there a free third-party componet to upload files?

Please I need your help.

thanks

 

 

 




View Complete Post


More Related Resource Links

Ajax Asyncfileupload doesn't work as soon as I put it in a control

  

Hi guys,

I can't get my <ajax:asyncfileupload> working and I don't see why...

When outside any panel or table it is working well, but as soon as I put it in a <asp:panel> or table I get a strange error which seems to be on client-side but I don't understand what's happen here. Here is the code and code-behind and Javascript.

Here's the error: 

http://screencast.com/t/Mjc0OWZi

Here's my front-code:

<%@ Page Language="VB" MasterPageFile="~/masterpages/mpSqueletton.master" AutoEventWireup="false" CodeFile="frmAdmGestSocietes.aspx.vb" Inherits="adm_frmAdmGestSocietes" title="Untitled Page" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
<script type="text/javascript" language="javascript">    
        function uploadError(sender,args)
        {
          document.getElementById("<%= lblStatus.ClientID %>").innerText = args.get_fileName(), "<span style='color:red;'>" + args.get_errorMes

displaying error message - Telerik MVC grid - AJAX mode

  
I want a common solution for handling error messages ON telerik mvc grid in ajax inline and popup edit modes. I am not talking about error messages that are related to single input field. These are business error messages that come back to grid from DB upon clicking grid edit or insert buttons. I want to dispaly error message and not loose data in input fields, bcaz in some cases we are talking about more than 20 fields. 1) I want to know the best way to handle error messges received from backend while using telerik mvc grid. 2) Is it possbile to display error message in a message dialog box?

Ajax Session timeout problem

  
Hi,  I have some problems when using AJAX with updatepanels. I have an ASP.NET webapplication with a login that uses form authentication with the timeout set to 5 min. After 5 min of idle the site should be redirected to the login.aspx page. My problem is that after using the site for 5 minutes when clicking on contents inside an updatepanel I get a messagebox with the following error: A Runtime Error has occurred.Do you wish to Debug? Line: 4723Error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12031  I think that it has something to do with the ajax updatepanel since when I remove the updatpanels this problem does not appear. Instead the site is redirected to login.aspx as expected. When searching on the problem on google I see alot of people having similar problem, but I haven't found suitable solution. Any suggestions?

Asp.net Ajax and session timeout

  
Hi, How do I handle a session timeout when using a updatepanel ?When the user session has timed-out and I click a button I get this error Sys.WebForms.PageRequestManagerParserErrorException - The message received from the server could not be parsed.I have tried to set EnabledEventValidation to false on the page but that didnt work, I have also tried to override the preInit on the page...didnt work either.Any ideas ?

Sharing the session variables between two .net applications using SQL Server Mode?

  
Hi, I have two different IIS applications within the same domain(let us say www.mydomain.com) , both of these applications use the same database instance(same connectionstring), now what I want is that both of applications can see each sessions variables , can SQL Server session state mode helps in this case? Did someone try that before? Is there any other way to share the session variables? Please help.  

Ajax AsyncFileUpload control not working in IE7.0 and IE8.0 browser in Integrated Windows Authentica

  

Hi, 

I am facing problem using Ajax AsyncFileUpload control in IE7.0 and IE8.0 browsers. 

It is working fine in local environment, when you deploy the code in Windows Server 2003 (IIS6.0) with Integrated Windows Authentication mode it is not working properly in IE7.0 and IE8.0 browsers. 

Issue: 

I am doing the validation in client side using OnClientUploadStarted, OnClientUploadComplete it is working fine but once click on any other button (server side) getting the error Internet Explorer cannot display the webpage (Diagnose Connection Problem) in IE7.0 and IE8.0 browser. Same thing is working fine in other browsers.

ajax AsyncFileUpload control is not working with IE9

  

AsyncFileUpload  not working with IE9. only on capability mode


Problem with the Ajax AsyncFileUpload control

  

I know what you're thinking: "oh, no. Not another one" :)

This is just some strange behavior I have observed on a user's machine.  During testing, and most of the time in production, the upload control has been working fine, but I am running into a problem.  I will preface this by saying that I have only seen this problem occur with a user running IE7, and that I don't know what their security settings are because the client has everyone's setting locked by group policy.

The problem is this:

The user browses for a file, selects one, and the file is uploaded immediately.  Everything fine there, but then they click on any other control on the page and the upload control immediately begins uploading again. Often, it seems, this second upload fails.  At the very least it is very time consuming and irritating for the users, since this second upload "cancels" the server request for the control they actually clicked on.

The AsyncUploadControl is not inside of any update panels, although there are several in use on the page. I've even seen this behavior when a user expands a DropDownList control with its "AutoPostback" property set to true.

I have gotten reports from several users at this client (this client accounts for 2/3 of the people using the system) that they are having problem

ReportViewer looping ajax calls to keep session alive causes Firefox to look like it's constantly r

  
In the HTML generated by the ReportViewer there is the following line of code (I've tried ot make it more readable by removing the superfluous information)
setTimeout("frames['ReportViewer1TouchSession0'].location.replace('/Reserved.ReportViewerWebControl.axd?...&TimerMethod=KeepAliveMethodReportViewer1TouchSession0...", 0);

function KeepAliveMethodReportViewer1TouchSession0() {
   setTimeout("frames['ReportViewer1TouchSession0'].location.replace('/Reserved.ReportViewerWebControl.axd?...TimerMethod=KeepAliveMethodReportViewer1TouchSession0....", -1703027296);
}

 

When the Reserved.ReportViewerWebControl.axd is called it makes a GET request that returns the following HTML:

 

<html><body><script type="text/javascript">parent.KeepAliveMethodReportViewer1TouchSession0();</script
></body></html>
 

 So in effect it becomes a recursive function and because KeepAliveMethodReportViewer1TouchSession0 calls a set timeout with a negative timeout value, in Firefox it's called immediately, in about 10 secon

in an async task session values are not getting saved when using OutProc mode

  

Hi,

my problem is that during a page load i am starting an async task, it is a time consuming calculation. If the user requests for the task to be shown on click of a button i have to render the results or show that task is still processing. for that i am using a boolean variable which is set to true when the task starts and if on click of the button the value is still true i show processing symbol

When the async task completes i set the boolean value as false and store the calculated datatable in session. The problem is that in an inproc mode, this logic works absolutely fine. but the moment i move to state server for storing the session values, both the boolean value in session and the datatable show their initial state, i.e. the state they were in when the async task started . I checked my async task,(tried background thread and async callback delegate both methods) and they were updating the seesion values when the task was completed. But somehow the changes are not committed.

Am i missing some configueration? or is there any way i can commit the changes from async task to my session variables


session timeout redirect in ajax calls

  

If a normal session timeout occurs we could handle the session timeout.

But say we are using a lot of ajax calls, webhandlers etc. How would we catch session timeout here and redirect to error/login page.

Thanks



AJAX AsyncFileUpload Javascript functions not working

  

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<script language="javascript" type="text/javascript">
    function uploadError(sender, args) {
        document.getElementById('lblStatus').innerText = args.get_fileName(), "<span style='color:red;'>" + args.get_errorMessage() + "</span>";
    }

    function StartUpload(sender, args) {
        document.getElementById('lblStatus').innerText = 'Uploading...';
    }

    function UploadComplete(sender, args) {
        var filename = args.get_fileName();
        var contentType = args.get_contentType();
        var text = "" + filename + "          |           " + args.get_length() + " bytes";
        document.getElementById('lblStatus').innerText = text;
    }
</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
        <asp:AsyncFileUpload ID="AsyncFileUpload1" runat="server" 
        OnClientUploadError="uploadError&

ReportViewer looping ajax calls to keep session alive causes Firefox to look like it's constantly r

  
In the HTML generated by the ReportViewer there is the following line of code (I've tried ot make it more readable by removing the superfluous information)
setTimeout("frames['ReportViewer1TouchSession0'].location.replace('/Reserved.ReportViewerWebControl.axd?...&TimerMethod=KeepAliveMethodReportViewer1TouchSession0...", 0);

function KeepAliveMethodReportViewer1TouchSession0() {
   setTimeout("frames['ReportViewer1TouchSession0'].location.replace('/Reserved.ReportViewerWebControl.axd?...TimerMethod=KeepAliveMethodReportViewer1TouchSession0....", -1703027296);
}

 

When the Reserved.ReportViewerWebControl.axd is called it makes a GET request that returns the following HTML:

 

<html><body><script type="text/javascript">parent.KeepAliveMethodReportViewer1TouchSession0();</script
></body></html>
 

 So in effect it becomes a recursive function and because KeepAliveMethodReportViewer1TouchSession0 calls a set timeout with a negative timeout value, in Firefox it's called immediately, in about 10 seconds Firebug logs over 150 GET requests in one minute there

Microsoft AJAX CDN

  
Content delivery networks (CDNs) are composed of "edge cache" servers that are strategically placed around the world at key Internet network points. These "edge cache" servers can be used to cache and deliver all types of content - including images, videos, CSS and JavaScript files.

Using a CDN can significantly improve a website's end-user performance, since it enables browsers to more quickly retrieve and download content. For example, instead of having a browser request for an image traverse all the way across the Internet to your web server to download, a CDN can instead serve the request directly from a nearby "edge cache" server that might only be a single network hop away from your customer (making it return much faster - which makes your pages load quicker).

AJAX GridView Checkbox Select All in ASP.Net

  
In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

AJAX GridView Paging and Sorting using C# in ASP.Net

  
To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

GridView Paging Using Ajax in ASP.Net

  
To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend