Solved

Populate aspx page from application object

Posted on 2008-06-25
2
290 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google Maps with Webforms 1 29
Table doesn't show the lines! 3 24
Set the FileVersion of a website dll 1 24
calculate days away 11 24
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 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