Solved

Populate aspx page from application object

Posted on 2008-06-25
2
303 Views
Last Modified: 2010-04-21
My code is attached

The code attached is the code which my primary site is redirecting to

I have text fields on this form that i want to fill from the following variables

application("WebUserContact")
application("WebUserCompany")
dict("JobDetailDescription")
dict("PurchaseOrder")
dict("ProofEmail")


should fill the text fields

txtname
txtcompany
txtpo
txtemail
txtdescription

The result would be that when the form loads these values will be populated.
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Upload.aspx.cs" Inherits="_Default" %>
 
<%@ Register Assembly="Mediachase.FileUploader" Namespace="Mediachase.FileUploader.Web.UI"
    TagPrefix="cc1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>KG File Upload</title>
    <link href="customerPortal.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="upload" runat="server" onsubmit="return validateData()">    
    <div style="left: 0px; position: absolute; top: 0px;">
        <asp:Image ID="imgHeader" runat="server" ImageUrl=".\grafix\home_page_logo.jpg" />
    </div>                
    <div id="divRAD" style="width: 764px; height: 60px; position: absolute; left: 10px; top: 110px;">
        <div id="divUploadInstructions" style="width: 750px; height: 58px; border-top-style: double; border-right-style: double; border-left-style: double; background-color: silver; border-bottom-style: double;">
            Use the "Browse" button to choose up to three files to be uploaded. 
            To decrease upload time, we recommend using
            <asp:HyperLink ID="lnkWinZip" runat="server" NavigateUrl="http://www.winzip.com"
                Target="_blank">WinZip</asp:HyperLink>
            or
            <asp:HyperLink ID="lnkStuffit" runat="server" NavigateUrl="http://www.stuffit.com"
                Target="_blank">Stuffit</asp:HyperLink>
            to compress the files. Warning: Files over 350MB may not upload properly when using
            Safari version 1.x</div>
        &nbsp; &nbsp;
        <asp:RequiredFieldValidator ID="rfvFile1" runat="server" ControlToValidate="mcFileUp"
            ErrorMessage="File #1: Name is Missing" SetFocusOnError="True"></asp:RequiredFieldValidator>&nbsp;
        <table bordercolor="#000000" bordercolordark="#000000" cellpadding="3" cellspacing="1"
            class="customerInfoTable" style="width: 754px">
            <tr>
                <td align="right" style="width: 88px">
                    <asp:Label ID="lblFile1" runat="server">File #1:</asp:Label></td>
                <td style="width: 493px">
                    <cc1:McHtmlInputFile ID="mcFileUp" runat="server" Height="25px" Size="60" />
                </td>
                <td align="right" style="width: 45px">
                    <asp:Label ID="lblType1" runat="server" Width="36px">Type:</asp:Label></td>
                <td>
                    <asp:DropDownList ID="lstFileType1" runat="server" Width="137px">
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td align="right" style="width: 88px">
                    <asp:Label ID="lblFile2" runat="server">File #2:</asp:Label></td>
                <td style="width: 493px">
                    <cc1:McHtmlInputFile ID="mcFileUp2" runat="server" Height="25px" Size="60" />
                </td>
                <td align="right" style="width: 45px">
                    <asp:Label ID="lblType2" runat="server" Width="36px">Type:</asp:Label></td>
                <td>
                    <asp:DropDownList ID="lstFileType2" runat="server" Width="137px">
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td align="right" style="width: 88px">
                    <asp:Label ID="lblFile3" runat="server">File #3:</asp:Label></td>
                <td style="width: 493px">
                    <cc1:McHtmlInputFile ID="mcFileUp3" runat="server" Height="25px" Size="60" />
                </td>
                <td align="right" style="width: 45px">
                    <asp:Label ID="lblType3" runat="server" Width="36px">Type:</asp:Label></td>
                <td>
                    <asp:DropDownList ID="lstFileType3" runat="server" Width="137px">
                    </asp:DropDownList></td>
            </tr>
        </table>
        &nbsp;
        &nbsp; &nbsp;&nbsp;
        <br />
        
       
        
        <div id="Div2" style="width: 750px; height: 19px; border-top-style: double; border-right-style: double; border-left-style: double; background-color: silver; border-bottom-style: double;">
            Be certain to provide details about this file upload to avoid delays in processing
            your order.</div>
        <br />
        <table border="0" bordercolor="#000000" bordercolordark="#000000" cellpadding="3"
            cellspacing="1" style="width: 754px" class="customerInfoTable">            
            <tr>
                <td align="right" style="width: 138px">
                    <asp:Label ID="lblName" runat="server">Name:</asp:Label></td>
                <td align="left" style="width: 514px">
                    <asp:TextBox ID="txtName" runat="server" Width="300px"></asp:TextBox>
                    *
                    <asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtName" ErrorMessage="bugu" SetFocusOnError="True">Required</asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td align="right" style="width: 138px">
                    <asp:Label ID="lblCompany" runat="server">Company Name:</asp:Label></td>
                <td align="left" style="width: 514px">
                    <asp:TextBox ID="txtCompany" runat="server" Width="300px"></asp:TextBox>
                    *
                    <asp:RequiredFieldValidator ID="rvfCompany" runat="server" ControlToValidate="txtCompany"
                        ErrorMessage="bugu" SetFocusOnError="True">Required</asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td align="right" style="height: 30px; width: 138px;">
                    <asp:Label ID="lblPO" runat="server">P.O. Number:</asp:Label></td>
                <td align="left" style="height: 30px; width: 514px;">
                    <asp:TextBox ID="txtPO" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td align="right" style="width: 138px">
                    <asp:Label ID="lblEmail" runat="server">E-mail Address:</asp:Label></td>
                <td align="left" style="width: 514px">
                    <asp:TextBox ID="txtEmail" runat="server" Width="300px"></asp:TextBox>
                    *
                    <asp:RequiredFieldValidator ID="rfvEmail" runat="server" ControlToValidate="txtEmail" SetFocusOnError="True">Required</asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td align="right" style="width: 138px">
                    <asp:Label ID="lblPhone" runat="server" Width="121px">Phone:</asp:Label></td>
                <td align="left" style="width: 514px">
                    <asp:TextBox ID="txtPhone" runat="server"></asp:TextBox>
                    *
                    <asp:RequiredFieldValidator ID="rfvPhone" runat="server" ControlToValidate="txtPhone" SetFocusOnError="True">Required</asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td align="right" style="width: 138px">
                    <asp:Label ID="lblRep" runat="server" Width="137px">KG Account Rep:</asp:Label></td>
                <td align="left" style="width: 514px">
                    <asp:DropDownList ID="lstAccountRep" runat="server" OnSelectedIndexChanged="lstAccountRep_SelectedIndexChanged"
                        Width="155px">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="rfvAccountRep" runat="server" ControlToValidate="lstAccountRep"
                        SetFocusOnError="True">Required</asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td align="right" style="width: 138px">
                    <asp:Label ID="lblDescription" runat="server">Job Description:</asp:Label></td>
                <td align="left" style="width: 514px">
                    <asp:TextBox ID="txtDescription" runat="server" Height="77px" Rows="3" TextMode="MultiLine"
                        Width="499px"></asp:TextBox></td>
            </tr>
        </table>
        <br />
        &nbsp;
        <asp:Button ID="btnSubmit" runat="server" CssClass="uploadButton" OnClick="btnSubmit_Click" Text="Upload" />
        <asp:Button ID="btnCancel" runat="server" CssClass="uploadButton" OnClick="btnCancel_Click" Text="Cancel" CausesValidation="False" /><br />
        <br />
        If you experience problems uploading your files, click
        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="mailto:webmaster@Testee.com">here</asp:HyperLink>
        to notify the webmaster<br />
        <br />
        &nbsp;</div><div style="left: 0px; position: absolute; top: 0px;">
            <asp:Image ID="Image1" runat="server" ImageUrl=".\grafix\home_page_logo.jpg" />
        </div>
        <div style="left: 0px; position: absolute; top: 780px;">
            <asp:Image ID="Image2" runat="server" ImageUrl="~/grafix/why_bottom_banner.jpg" />
        </div>
    </form>
    
    <SCRIPT LANGUAGE="JavaScript" type="text/javascript" src="CustomerPortal.js"></SCRIPT> 
 
                
</body>
</html>

Open in new window

0
Comment
Question by:rmardis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
philipjonathan earned 500 total points
ID: 21871596
In your code behind, handle the Page_Load event and key in the following.
Alternatively, enclose the following code with <script runat="server">.
  Sub Page_Load
    If Not IsPostBack Then
      txtname.Text = application("WebUserContact")
      txtcompany.Text = application("WebUserCompany")
      txtpo.Text = dict("PurchaseOrder")
      txtemail.Text = dict("ProofEmail")
      txtdescription.Text = dict("JobDetailDescription")
    End If
  End Sub

Open in new window

0
 

Author Closing Comment

by:rmardis
ID: 31470842
You nailed it!  Thank you so much for the speedy answer!!!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question