Where to find help with ASP.NET...

G

Guest

.... when no one here has an answer?

Does MS offer support for its programming products where that support
doesn't cost an arm and a leg, but where you can at least get a response?

I'm not trying to be a jerk, I know that support on these newsgroups is
voluntary, and I'm not jumping on anyone for not being able to answer some of
the questions that are asked here.

It just gets frustrating when a component in a MS product like ASP.NET
doesn't work as specified in the documentation, and there's no other help out
there to be found. Google returns only references to the MS documentation,
and no other ASP.NET site addresses the component in question
(maxrequestlength) when it's used in an ASPX page itself rather than
web.config. I suppose its because this ability is new in 2.0, but still, the
documentation should have better examples, or give the correct usage. </rant>
 
D

David R. Longnecker

Trust me, I do understand.

Your options vary depending on your environment.

If you are a Microsoft MSDN member, your support levels are a bit higher
in the newsgroups, but you must remember to use your assigned email suffix
(I'm assuming these busy folks have filters setup to help take care of the
MSDN members promptly). Responses are on a voluntary basis, but I've found
some of the best responses here.

If you are a preferred Microsoft customer, and have access to the Enterprise
portal, then you can open a set number of support tickets with Microsoft
developers. My experience with this has been poor, but your mileage may
vary.

From there, it becomes a balance of what an "arm and a leg" are worth. ;)
The pay-per-call incidents can help out if you have a very complicated question
or process you are working through. They're single charge and remain open
until you have the answer YOU seek. We've opened one of these up for some
tricky MCMS work and were quite satisified.

Finally, one source that may not be QUITE as useful, but has lead me down
the right path for a few occassions is O'Reilly's new code search engine
(http://labs.oreilly.com/code/) and the specialized searches through Google
(specifically Microsoft's (http://www.google.com/microsoft.html), through
Clinton's example can provide the same results if you know the site).

Past that, as I said, I do understand and ask if you find the shining font
of knowledge, to please share. :D

-dl
 
G

Guest

Not that exact search, but similar. It gives me the same pages I've already
read. Three times. :^)

Thanks, Clinton.
 
G

Guest

Juan T. Llibre said:
Do you have a specific question ?

Yes. I asked it on the 21st, and got no responses.

But since you asked... :) I'll repost it here.

It was titled, "Setting MaxRequestLength in the page."

I'm running into the notorious 4MB upload limit. I see where one answer is
to set a higher limit to the httpRunTime MaxRequestLength setting in
web.config. However this affects the whole application, and if I'm going to
increase this limit, I'd rather only increase it for the one page that needs
it, the one with the FileUpload controls.

So it was great to see the .NET Framework 2.0 now allegedly supports this in
the page. I tried it (the application is set to the 2.0 Framework,, and
I'm using VS2005). I removed the setting in web.config so that all pages
would default to the 4MB limit. Then, on my page with the FileUpload
controls, I added the following code:

<%@ import Namespace="System.Web.Configuration" %>

Dim httpConfig As HttpRuntimeSection = New HttpRuntimeSection

Sub Page_Load()
httpConfig.MaxRequestLength = 8192
... other code to handle the uploading ...
End Sub

However, it doesn't seem to work. I still get the "Maximum request length
exceeded" errors when I upload a file larger than 4MB.

Am I implementing this properly, or am I missing something?

-Robert-
 
J

Juan T. Llibre

re:
So it was great to see the .NET Framework 2.0 now allegedly supports this in the page.

I'm not so sure that's true.

AFAIK, you can only set MaxRequestLength in :

1. Machine.config
2. Root-level Web.config
3. Application-level Web.config
4. Virtual or physical directory-level Web.config

Where did you read that changing the
httpRuntime's MaxRequestLength can be done at the page level ?
 
J

Jon Paal

How to control the size of file uploaded to the web server?
While uploading a file to the web server, we have a limit of 4MB by default. We can either decrease or increase this value. The
value is set in the key, maxRequestLength of machine config file.

There is a maxRequestLength limit in the machine.config file (look for the <system.web> section), in the httpRuntime settings that
you need to alter/raise if you want to accept anything larger than 4Mb. These are the standard settings for the httpRuntime:

<httpRuntime executionTimeout="90" maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false" minFreeThreads="8"
minLocalRequestFreeThreads="4" appRequestQueueLimit="100"/>
 
G

Guest

Juan T. Llibre said:
re:
So it was great to see the .NET Framework 2.0 now allegedly supports this in the page.

I'm not so sure that's true.

[...]

Where did you read that changing the
httpRuntime's MaxRequestLength can be done at the page level ?

Here:
http://msdn2.microsoft.com/en-us/li...tion.httpruntimesection.maxrequestlength.aspx

MaxRequestLength is a public property of the HttpRuntimeSection Class
described here:
http://msdn2.microsoft.com/en-us/library/system.web.configuration.httpruntimesection_members.aspx

Unless I'm completely misunderstanding what I'm reading, in which case my
complaint about MS's documentation remains.
 
G

Guest

Thank you, Jon. But I don't want to increase the file upload sizes for the
whole web site, or even for the whole application, just a single page. And
according to the MS documentation for ASP.NET 2.0 (please see the links I
gave in my reply above to Juan), it can be done in the page. Or am I reading
that incorrectly? It sure looks like VB code to me, and not web.config XML
code.

-Robert-
 
J

Juan T. Llibre

I will stick my neck out and say that the documentation is mistaken.

Page developers can use the HttpRuntime class properties to find out
information about the current application domain for diagnostic purposes, for example.

The HttpRuntime object is used at the beginning of the
ASP.NET pipeline model that processes HTTP requests.

The ProcessRequest method drives all subsequent ASP.NET Web processing.

Since, if you change any httpruntime property, the result would need to be
handled by a new process, you can't get there from here if you attempt to
change, on the fly, the httpruntime's operational parameters.

My curiosity was piqued by your experience, so I tested the scenario.

Sure enough, I could, apparently, change the MaxRequestLength property.
But, just like you reported, the upload procedure failed

Here's what I used :

Sub Page_Load(obj as object, e as eventargs)
Dim httpConfig As HttpRuntimeSection = New HttpRuntimeSection
lblMaxRequestLength.Text = httpConfig.MaxRequestLength
httpConfig.MaxRequestLength = 8192
lblMaxRequestLength2.Text = httpConfig.MaxRequestLength
End Sub

Sub Button1_Click(sender As Object, e As EventArgs)

If FileUpLoad1.HasFile
FileUpLoad1.SaveAs("C:\" & FileUpLoad1.Filename)
Label1.Text = "Received " & FileUpLoad1.FileName & " Content Type " _
& FileUpLoad1.PostedFile.ContentType & " Length " & FileUpLoad1.PostedFile.ContentLength
Else
Label1.Text = "No file was uploaded"
End If
End Sub

When the page loads, lblMaxRequestLength reports that MaxRequestLength is 4096,
and lblMaxRequestLength2 reports that MaxRequestLength ( changed in Page_Load )
is 8192, but when I tried uploading a 6MB file, the process failed.

An automatic AppDomain restart should occur when any httpRuntime parameter is modified.

The problem, of course, is that when the AppDomain restarts, it goes right back
to the default httpruntime parameters specified in web.config or machine.config.

It looks like you found a documentation error.

If you feel strongly enough about this, bug it at the Feedback Center:
http://connect.microsoft.com/feedback/default.aspx?SiteID=210





salty said:
Juan T. Llibre said:
re:
So it was great to see the .NET Framework 2.0 now allegedly supports this in the page.

I'm not so sure that's true.

[...]

Where did you read that changing the
httpRuntime's MaxRequestLength can be done at the page level ?

Here:
http://msdn2.microsoft.com/en-us/li...tion.httpruntimesection.maxrequestlength.aspx

MaxRequestLength is a public property of the HttpRuntimeSection Class
described here:
http://msdn2.microsoft.com/en-us/library/system.web.configuration.httpruntimesection_members.aspx

Unless I'm completely misunderstanding what I'm reading, in which case my
complaint about MS's documentation remains.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top