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/
|