Solved

Populate aspx page from application object

Posted on 2008-06-25
2
267 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
2 Comments
 
LVL 18

Accepted Solution

by:
philipjonathan earned 500 total points
Comment Utility
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
Comment Utility
You nailed it!  Thank you so much for the speedy answer!!!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now