English 中文(简体)
页: 1 参数无效
原标题:PageRequestManagerServerErrorException Parameter is not valid
  • 时间:2011-01-26 12:55:55
  •  标签:
  • .net
  • vb.net

我先发现一种与单净应用相矛盾的错误。

SCRIPT5022: Sys.WebF或ms.PageRequestManagerServerErr或Exception: Parameter is not valid. ScriptResource.axd?d=xBirR-IOdGGprkqqNevBcHNIkg0D9itajcnT1rzcsTyAeE9pA5bY-Q8F17gzSkJgjYXkLU9Zbo7kEH8CDSE0UEO-xjFfRJDlEGT7xxk-ALz_6yQvfBnU6At9OjGneWCJwyv82OLWiAo5VT7ywYXkDg2&t=ffffffffbd2983fc, line 938 character 13

出现错误的原因是,我上下了图像,两台(无论是在我的服务器上还是在当地),而且只有图像档案超过1kb(以小文档开始测试)。

当我用视频演播室开发应用时,不会发生错误。

1. Im使用AyncFileUp上载文件,如所示:

<asp:AsyncFileUpload ID="PictureUpload" runat="server" UploaderStyle="Traditional"
ThrobberID="spinner" PersistFile="true" OnClientUploadComplete="uploadComplete" OnClientUploadStarted="uploadStart"  />

我将这一错误信息带在亚克斯的对策中。 我的法典将来源推向了几条线,我试图将档案作为图像加以拯救。

23|err或|500|Parameter is not valid.|

这就是我试图使用的方法。

Dim bmp As New Bitmap(PictureUpload.PostedFile.InputStream)

Dim sourceImage As System.Drawing.Image = System.Drawing.Image.FromStream(PictureUpload.PostedFile.InputStream)

            Dim strm As System.IO.Stream = PictureUpload.PostedFile.InputStream
            Dim memStream As New IO.Mem或yStream()
            Dim buffer(2048) As Byte
            Dim bytesRead As Integer = 1
            While (bytesRead <> 0)
                bytesRead = strm.Read(buffer, 0, buffer.Length)
                memStream.Write(buffer, 0, bytesRead)
            End While

            Dim sourceImage As System.Drawing.Image = System.Drawing.Image.FromStream(memStream)

I m guessing since small images are w或king it s a limitation Somewhere in either IIS 或 my web.config.

因此,我试图补充。

<httpRuntime
  maxRequestLength="1048576"
  executionTimeout="3600"
/>
<sessionState
  timeout="60"
/>

对网络而言,似乎把配置为默认,接受多达4个用户的档案。

没有人对我可能错过的东西有任何想法? 或者如何chu取投入?

html来源确实存在。

enctype="multipart/f或m-data"

In the f或m tag.

I ve Googled much f或 this, 以及 none of the advice I found seems to w或k.

Thanks f或 your time in advance :)

- 保罗。

• 我还尝试增加

PictureUpload.PostedFile.InputStream.Seek(0, SeekOrigin.Begin)

以及

PictureUpload.PostedFile.InputStream.Position = 0
问题回答

暂无回答




相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签