BrettDerry

Hi,

I have a simple File Upload form:

<asp:Panel ID="pnlUploadForm" runat="server" Height="50px" Width="90%">
Please make sure your CV fits the following guidelines:<br />
<br />
<asp:Label ID="lblGuidelines" runat="server" Text="-- CV Guidelines --"></asp:Label><br />
<asp:HiddenField ID="IsFormPosted" runat="server" Value="True" />
<br />
<asp:FileUpload ID="objFileUpload" runat="server" />
<br />
<br />
<asp:Button ID="cmdUpload" runat="server" Text=" Upload " OnClick="cmdUpload_Click" />
<asp:Button ID="cmdCancel" runat="server" Text=" Cancel " />
</asp:Panel>
<asp:Panel ID="pnlUploadStatus" runat="server" Height="50px" Visible="False" Width="90%">
<asp:Label ID="lblStatus" runat="server" Text="Please wait, we are currently processing your application..."></asp:Label>
</asp:Panel>

I want a bit of basic validation to see if the form has already been submitted > show one panel if not, hide if so.

if
(HttpRequest["IsFormLoaded"] = true)
{
pnlUploadStatus.Visible = true;
pnlUploadForm.Visible = false;

UploadFile();
}

else
{
lblGuidelines.Text = GenerateFileSpec();
pnlUploadStatus.Visible = false;
pnlUploadForm.Visible = true;
}

How do I pass the ID of <asp:HiddenField ID="IsFormPosted" runat="server" Value="True" /> into the HTTPRequest type

Thanks,
Brett


Re: Visual C# Language HTTPRequest problem when trying to get ID of <asp:Panel>

Burak SARICA

Why do you need HTTPRequest

if (bool.Parse(IsFormPosted.Value))

{

//...do something.

}

else

{

//do something different.

}