K
Ken Grimmett
I have added a REV to an input type of file. I want to make sure that the
only file type that is allowed is a .gif, .jpg, or .jpeg. I develop my site
on my laptop which is running Win XP Pro and my site is hosted on a Win 2000
Advanced server. Here is my problem. When I test it on my local host of
the XP Pro machine the validator works. When I migrate it to the W2K box it
doesn't work. There is no error that is displayed. Is anyone aware of
this. Not sure if it makes a difference or not but the code is in a control
that is displayed.
Here is the code
<%@ import Namespace="ASPNET.StarterKit.Communities" %>
<%@ Register TagPrefix="community" Namespace="ASPNET.StarterKit.Communities"
Assembly="ASPNET.StarterKit.Communities" %>
<%@ Control %>
<%--
This skin is used both for adding and editing a photo. Modify the HTML
content
to modify the appearance of the page.
--%>
<community:SectionTitle CssClass="Form_Title" Runat="server"
id="SectionTitle1" />
<p class="Form_Description">Use this form to upload images to the portal.
You can
rename files before uploading them.</p>
<p>
<communityisplayQuota runat="server" id="DisplayQuota1" />
</p>
<TABLE id="Table2" cellSpacing="0" cellPadding="3" class="Form_Table"
border="0">
<TR>
<TD class="Form_SectionRow">
Add Photo Form
<DIV></DIV>
</TD>
</TR>
<TR class="Form_LabelRow">
<TD class="Form_LabelText">
<div>
<span class="Form_LabelText">Image File </span>
<community:UploadValidator id="valUpload"
ControlToValidate="txtPhotoFile" Text="(required)" Runat="Server" />
<br>
<span class="Form_HelpText">(For example, C:\Images\Book.jpg)</span>
</div>
<input id="txtPhotoFile" type="file" Size="40" Runat="Server"><br>
<asp:RegularExpressionValidator ControlToValidate="txtPhotoFile"
ID="revTxtPhotoFile" Runat="server" ErrorMessage="Image must be a gif or
jpg/jpeg format."
ValidationExpression="(.*\.([gG][iI][fF]|[jJ][pP][gG]|[jJ][pP][eE][gG])$)"><
/asp:RegularExpressionValidator>
<br>
<communityisplayPhotoImage id="imgPhoto" Width="100" Runat="Server" />
</TD>
</TR>
<tr>
<td class="Form_LabelText">
<aspanel id="pnlTopics" runat="Server">
<SPAN class="Form_LabelText">Topic</SPAN>
<asp:RequiredFieldValidator id="RequiredFieldValidator1" Runat="server"
CssClass="Form_Field" Text="(required)"
ControlToValidate="dropTopics"
InitialValue="-1"></asp:RequiredFieldValidator>
<BR>
<community:TopicPicker id="dropTopics"
runat="Server"></community:TopicPicker>
</aspanel>
</td>
</tr>
<TR>
<TD class="Form_LabelText">
<div>
<span class="Form_LabelText">Name </span>
<br>
<span class="Form_HelpText">(For example, 'Summer Trip')</span>
<asp:RequiredFieldValidator ControlToValidate="txtPhotoTitle"
Text="(required)" CssClass="Form_Field" Runat="server"
id="RequiredFieldValidator2" />
</div>
<asp:TextBox id="txtPhotoTitle" CssClass="Form_Field" Columns="40"
runat="server"></asp:TextBox>
<P></P>
</TD>
</TR>
<TR>
<TD class="Form_LabelText" colSpan="2">
<div>
<span class="Form_LabelText">Caption </span>
<br>
<span class="Form_HelpText">(This information is listed on the Pictures
page.)</span>
<asp:RequiredFieldValidator ControlToValidate="txtPhotoBriefDescription"
Text="(required)" Display="Dynamic"
CssClass="Form_Field" Runat="server" id="RequiredFieldValidator3" />
<community:LengthValidator Maxlength="500"
ControlToValidate="txtPhotoBriefDescription" Text="(less than 500
characters)"
CssClass="Form_Field" Runat="server" id="LengthValidator1" />
</div>
<asp:TextBox id="txtPhotoBriefDescription" CssClass="Form_Field"
runat="server" TextMode="MultiLine"
Rows="5" Width="508px"></asp:TextBox>
<P></P>
</TD>
</TR>
<TR>
<TD class="Form_LabelText" colSpan="2">
<div>
<span class="Form_LabelText">Full Description</span>
<br>
<span class="Form_HelpText">(Optional. Users can access this information
when they press the 'Read More' link.)</span>
</div>
<community:HtmlTextBox id="txtPhotoFullDescription" runat="server"
Rows="5" Width="508px" />
</TD>
</TR>
<TR>
<TD align="right" colSpan="2" class="Form_SectionRow">
<asp:Button id="btnAdd" CssClass="Form_Button" Runat="server" Text="Add
New Image"></asp:Button>
<asp:Button id="btnEdit" CssClass="Form_Button" Runat="server"
Text="Apply Changes"></asp:Button>
</TD>
</TR>
</TABLE>
<p>
</p>
only file type that is allowed is a .gif, .jpg, or .jpeg. I develop my site
on my laptop which is running Win XP Pro and my site is hosted on a Win 2000
Advanced server. Here is my problem. When I test it on my local host of
the XP Pro machine the validator works. When I migrate it to the W2K box it
doesn't work. There is no error that is displayed. Is anyone aware of
this. Not sure if it makes a difference or not but the code is in a control
that is displayed.
Here is the code
<%@ import Namespace="ASPNET.StarterKit.Communities" %>
<%@ Register TagPrefix="community" Namespace="ASPNET.StarterKit.Communities"
Assembly="ASPNET.StarterKit.Communities" %>
<%@ Control %>
<%--
This skin is used both for adding and editing a photo. Modify the HTML
content
to modify the appearance of the page.
--%>
<community:SectionTitle CssClass="Form_Title" Runat="server"
id="SectionTitle1" />
<p class="Form_Description">Use this form to upload images to the portal.
You can
rename files before uploading them.</p>
<p>
<communityisplayQuota runat="server" id="DisplayQuota1" />
</p>
<TABLE id="Table2" cellSpacing="0" cellPadding="3" class="Form_Table"
border="0">
<TR>
<TD class="Form_SectionRow">
Add Photo Form
<DIV></DIV>
</TD>
</TR>
<TR class="Form_LabelRow">
<TD class="Form_LabelText">
<div>
<span class="Form_LabelText">Image File </span>
<community:UploadValidator id="valUpload"
ControlToValidate="txtPhotoFile" Text="(required)" Runat="Server" />
<br>
<span class="Form_HelpText">(For example, C:\Images\Book.jpg)</span>
</div>
<input id="txtPhotoFile" type="file" Size="40" Runat="Server"><br>
<asp:RegularExpressionValidator ControlToValidate="txtPhotoFile"
ID="revTxtPhotoFile" Runat="server" ErrorMessage="Image must be a gif or
jpg/jpeg format."
ValidationExpression="(.*\.([gG][iI][fF]|[jJ][pP][gG]|[jJ][pP][eE][gG])$)"><
/asp:RegularExpressionValidator>
<br>
<communityisplayPhotoImage id="imgPhoto" Width="100" Runat="Server" />
</TD>
</TR>
<tr>
<td class="Form_LabelText">
<aspanel id="pnlTopics" runat="Server">
<SPAN class="Form_LabelText">Topic</SPAN>
<asp:RequiredFieldValidator id="RequiredFieldValidator1" Runat="server"
CssClass="Form_Field" Text="(required)"
ControlToValidate="dropTopics"
InitialValue="-1"></asp:RequiredFieldValidator>
<BR>
<community:TopicPicker id="dropTopics"
runat="Server"></community:TopicPicker>
</aspanel>
</td>
</tr>
<TR>
<TD class="Form_LabelText">
<div>
<span class="Form_LabelText">Name </span>
<br>
<span class="Form_HelpText">(For example, 'Summer Trip')</span>
<asp:RequiredFieldValidator ControlToValidate="txtPhotoTitle"
Text="(required)" CssClass="Form_Field" Runat="server"
id="RequiredFieldValidator2" />
</div>
<asp:TextBox id="txtPhotoTitle" CssClass="Form_Field" Columns="40"
runat="server"></asp:TextBox>
<P></P>
</TD>
</TR>
<TR>
<TD class="Form_LabelText" colSpan="2">
<div>
<span class="Form_LabelText">Caption </span>
<br>
<span class="Form_HelpText">(This information is listed on the Pictures
page.)</span>
<asp:RequiredFieldValidator ControlToValidate="txtPhotoBriefDescription"
Text="(required)" Display="Dynamic"
CssClass="Form_Field" Runat="server" id="RequiredFieldValidator3" />
<community:LengthValidator Maxlength="500"
ControlToValidate="txtPhotoBriefDescription" Text="(less than 500
characters)"
CssClass="Form_Field" Runat="server" id="LengthValidator1" />
</div>
<asp:TextBox id="txtPhotoBriefDescription" CssClass="Form_Field"
runat="server" TextMode="MultiLine"
Rows="5" Width="508px"></asp:TextBox>
<P></P>
</TD>
</TR>
<TR>
<TD class="Form_LabelText" colSpan="2">
<div>
<span class="Form_LabelText">Full Description</span>
<br>
<span class="Form_HelpText">(Optional. Users can access this information
when they press the 'Read More' link.)</span>
</div>
<community:HtmlTextBox id="txtPhotoFullDescription" runat="server"
Rows="5" Width="508px" />
</TD>
</TR>
<TR>
<TD align="right" colSpan="2" class="Form_SectionRow">
<asp:Button id="btnAdd" CssClass="Form_Button" Runat="server" Text="Add
New Image"></asp:Button>
<asp:Button id="btnEdit" CssClass="Form_Button" Runat="server"
Text="Apply Changes"></asp:Button>
</TD>
</TR>
</TABLE>
<p>
</p>