Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 4th, 2003, 10:12 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default HTMLInput Control / Something weird

Hi Guys,

I have three questions; two about the HTMLInputControl and one about something funny that happens in my asp.net page.

1. In Professional ASP.NET, when discussing the HTMLInputControl, the authors set the property 'accept' to limit the filetypes that can be uploaded through the control. I'm trying to limit my control to just Imagefiles (accept="image/x"). This, however, doesn't seem to work. Any clues as to why it won't accept this? Even VS throws an error when I load the page. (Declararion: <input type="file" id="MyFileInput" accept="image/*" runat="server" size="48">)

2. The same HTMLInputControl acts sort of weird. Not sure if this is due to a misconception on my part, or that it's actually some sort of an error. Basically I want to verify whether the user actually submitted anything to the control. If not, I want to send a blank string to me database (A NULL String). I've tried the following statements, all without success. For some reason, the ASP.NET page still seems to think that something WAS actually submitted to the control.

If Not (MyFileInput.Value Is Nothing) Then
If Not (MyFileInput.PostedFile Is Nothing) Then
If Not (MyFileInput.PostedFile.ContentLength > 0) Then

Any help? This is seriously starting to bug me :(

3. I've defined a few asp:textbox controls on my page. One of them suddenly started to show up with a different bg-color, even though I never set that anywhere. I did add two validationcontrols to the textbox, but that still shouldn't cause it's bgcolor to change by itself if you ask me.

Definition:

<asp:label id="Label6" runat="server" width="100px">
E-mail Address: </asp:label>

<asp:textbox id="txtUserEmail" runat="server" Width="307px">
</asp:textbox>

<asp:requiredfieldvalidator id="RequiredUserEmail" runat="server"
    ErrorMessage="* Please enter your E-mail address!" ControlToValidate="txtUserEmail" Display="dynamic">
    *
</asp:requiredfieldvalidator>
<asp:regularexpressionvalidator id="ValidateUserEmail" runat="server" ControlToValidate="txtUserEmail"
        ValidationExpression=".*@.*\..*"
    ErrorMessage="* Please supply a valid E-mail address!"
        Display="dynamic">
    *
</asp:regularexpressionvalidator></p>

I'm so lost on this. These are a few of the little irks I have last before having finished my page. Any help would be greatly appreciated.

Thanks in advance.

Peter

__________________
http://entropia-online.blogspot.com/
 
Old September 4th, 2003, 10:18 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

#3: 10 Bucks says you just installed the latest Google toolbar!

They have a new "form autofill" feature which colors input fields that it assumes it can fill such as your "txtUserEmail"
 
Old September 4th, 2003, 10:25 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 143
Thanks: 0
Thanked 1 Time in 1 Post
Default

What's your paypal account? :D

I think I actually just found the #2 error. *bashes head into keyboard*

I forgot a damn closing tag at the end of the input control.

Ah well. At least I found it :)

That leaves #1 open I think.

Peter






Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird Concantenation jazzcatone SQL Server 2000 1 November 14th, 2006 10:42 AM
Weird Errors kervinshim Classic ASP Databases 3 April 25th, 2004 04:08 AM
htmlInput control doesn't work with Access file? huilyu HTML Code Clinic 0 October 16th, 2003 06:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.