473,395 Members | 1,797 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,395 software developers and data experts.

Problems with HtmlInputFile & Page Inheritance

I'm converting a c# web application to support page inheritance so that I
can really change the look and feel of my application by only modifying the
..cs that my pages inherit from.

The only recurring problem I'm having is that none of my HtmlInputFile
controls are working after the conversion.

The page inheritance setup is pure vanilla, copied from some examples on the
web. All the fron end stuff is inside a form tag, etc.. But when any of my
pages try to access an HtmlInputFile control, I get the generic, annoying
error:

Object reference not set to an instance of an object.
at this line
if (txtFileUp.PostedFile.FileName != null && txtFileUp.PostedFile.FileName
!= "")

Any idea?
Nov 17 '05 #1
1 1407
i must be having a bad morning, I forgot to add
enctype="multipart/form-data"
to my form...

"George Durzi" <gdurzi@nospam_hotmail.com> wrote in message
news:Od**************@TK2MSFTNGP09.phx.gbl...
I'm converting a c# web application to support page inheritance so that I
can really change the look and feel of my application by only modifying the .cs that my pages inherit from.

The only recurring problem I'm having is that none of my HtmlInputFile
controls are working after the conversion.

The page inheritance setup is pure vanilla, copied from some examples on the web. All the fron end stuff is inside a form tag, etc.. But when any of my
pages try to access an HtmlInputFile control, I get the generic, annoying
error:

Object reference not set to an instance of an object.
at this line
if (txtFileUp.PostedFile.FileName != null && txtFileUp.PostedFile.FileName
!= "")

Any idea?

Nov 17 '05 #2

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

Similar topics

2
by: Skwish | last post by:
Hi, I have a page with a htmlInputFile that is working fine. However, if I go to another page, and then go back to the page with the htmlInputFile, I get the following error Warning: Page...
9
by: Rob Meade | last post by:
Hi all, I've got some code here that builds a page dynamically, ie, added a table, rows, cells, controls in the cells and so on... Everything has gone fine until now, I need to add a 'File...
5
by: Grant Harmeyer | last post by:
I have an application that uses FreeTextBox 2.0 (http://www.freetextbox.com). FreeTextBox is a rich text editor that behaves similarly to MS Word. The FreeTextBox control has a button to insert...
2
by: Augusto Cesar via DotNetMonster.com | last post by:
Hi, I want to customize the HtmlInputFile. I wanna something like an image button to play the "browse" button hole and hide the textbox. Is that possible? I also have tried to hide an...
4
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
0
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
3
by: UJ | last post by:
Guys, I know this isn't the appropriate place to post this because it's HTML not ASP.Net but I need some guidance. I have a web page with an HTMLInputFile on it. The person enters the stuff,...
7
by: Buddy Ackerman | last post by:
I created this class Public Class HTMLFileInput : Inherits System.Web.UI.HtmlControls.HtmlInputFile Public Property Data As String Get Return ViewState("HTMLFileInput.Data") End Get Set...
3
by: Dave Adler | last post by:
Is there any way to retain the value of an HtmlInputFile control through a postback? I do some server side validation on the page when it is submitted and if an error occurs on the page the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.