473,398 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

working with HTTPRequest in Page_Load - problems.

Hello,

Hello

I'm tinkering with .NET, and I like the idea of being able to use compiled c# in
"code behind" even where the client side user doesn't have the .net framework
installed, i.e. for general web based applications.

So what I did was remove everything in the .aspx file except the

<%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="false"
Inherits="lmyProj.WebForm2" %>

line.

My idea was to handle the Request in the Page_Load method of the code behind.
I can output data using the Response property OK, but the Request seems to be
uninitialised - for instance if I send a form which invokes my page, the "Form"
property has Count = 0, not 1.

Also if the form includes a "File" component, the count of files in the request
is always 0. (I have set enctype="multipart/form-data")

I'm doing this so I can run what is to all intents and purposes a CGI executable
on in an ISP who doesn't allow executables, but does allow ASP.NET.

Maybe I should be pursuing some other route?

Or any other help, pointers greatfully received...

Jim
Nov 17 '05 #1
2 1631
OK - I fixed it - so for posterity and future Googlers of the group :-

1) specificy method = post

<form id="Form1" action="http://localhost/listyourself/webform2.aspx"
enctype="multipart/form-data" method=post>
2) input *must* have a name attribute, or it doesn't appear in the "files"
collection ...
<INPUT type="file" id="fileone" name="fileone">

and that seems to be it, then the data turns up in the request, and faking can
continue :-)

J
Nov 17 '05 #2
On Tue, 11 Nov 2003 13:03:06 GMT, ji*******@getit.someotherway (Jim Lawton)
wrote:
Hello,

Hello

I'm tinkering with .NET, and I like the idea of being able to use compiled c# in
"code behind" even where the client side user doesn't have the .net framework
installed, i.e. for general web based applications.


So now I've discovered that *theoretically* it all works for any browser on any
os (ho ho ho) - but anyway, there's no requirement to have the .net framework
installed.

But and, the whole thrust of my idea was dross, and there is a much more elegant
solution to the problem, an example i+ the creation of dynamic pages using
XML/XSL at :-

http://www.sitepoint.com/article/1001/1

Got to stop answering my own questions :-)

Jim
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: HikksNotAtHome | last post by:
In Mozilla 1.4b, when the URL is set to a local URL, it works as expected. function showIt(){ var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "blank.html" ,true);...
5
by: warteschlange | last post by:
i want to postload javscript from another javascript. This works fine in firefox and IE6 for macIE i can use an Iframe to load the code and inject it with insertAdjacentHTML The problems arise...
14
by: V. Jenks | last post by:
I'm a little rusty having not touched .NET for 6 months and I can't remember why Page_Load is happening twice in this code: private void Page_Load(object sender, System.EventArgs e) {...
11
by: Keith Patrick | last post by:
Could someone explain to me the relationship between these two classes? I am ripping my hair out trying to divert an HttpRequest to a new location via an HttpWebRequest, but I cannot get my...
1
by: Gunnar | last post by:
I am finding some unusual behavior with techniques I am using to show/hide/update data without having to refresh the page. I'm quite sure it's developer ignorance on my part and would be grateful...
6
by: eulaersivan | last post by:
I would like to use the xmlhttprequest-object to send an http request to my server. The http request is used to switch the light on through home automation. However it's not working, and I can't...
1
by: dlong | last post by:
I am attempting to use a simple querystring passed from a VB application into my aspx page, ASP .NET 2.0. The following error appears no matter how it is arranged as suggested in the forum search...
1
by: Jeff | last post by:
ASP.NET 2.0 I'm about to program a HttpRequest from my asp.net 2.0 website. I'll request another server using HttpRequest and ask if password etc are okay.... So I've looked into the...
4
by: David C | last post by:
I spent the last four hours trying to figure out why Page_Load would execute twice. Even stranger was that everything within if (! IsPostBack){....} executed twice as well. There is no rhyme or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.