[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Transfering user input from one page to another.

Asked by P1ST0LPETE in Programming for ASP.NET, WebApplications, Microsoft Programming

Tags: ASP.Net : C#

Unsing asp.net C#  -  .NET Framework 1.1

Hi,

I'm getting hung up while transferring user input from one page to another.  Attached is the current code.
Using this code I'm getting the following error:

Compiler Error Message: CS0122: 'ASP.default_aspx.tbFirstName' is inaccessible due to its protection level
Source Error:
Line 12:       try
Line 13:       {
Line 14:           this.lbFirstName.Text = PreviousPage.tbFirstName.Text;
Line 15:         }
Line 16:         catch (Exception ex)

I'm not understanding how the variable is inaccessible due to its protection.  All my methods are public, except for the opening "protected void Page_Load(Object s, EventArgs e)" which I tried changing the protected to public, and that still didn't work.  Would using Session variables better/easier?  I'd like to avoid cookies, since you never know when/if someone has them turned off on their browser.  

I'm completely new to this, so any info/advice whether fixing the current code, or going about it a totally different way would be appreciated.

 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
Code on the Default Page:
public string FirstName
{
    get
    {
        return tbFirstName.Text;
    }
}
 
 
Code on the Edit Page:
 
<%@ Page Language="C#" Debug="true" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ PreviousPageType VirtualPath="Default.aspx" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Inetpub\\wwwroot\\InsightDatabase\\App_Data\\InsightDatabase.mdb");
 
protected void Page_Load(object sender, EventArgs e)
{
    if (Page.PreviousPage != null)
    {
    try
    {
	this.lbFirstName.Text = PreviousPage.tbFirstName.Text;
    }
    catch (Exception ex)
    {
        lbFirstName.Text = ex.Message;
    }
    }
    else
    {
        lbFirstName.Text = "You must fill out the form.";
    }
}
</script>
[+][-]03/17/08 11:32 AM, ID: 21144791Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/17/08 11:34 AM, ID: 21144804Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Programming for ASP.NET, WebApplications, Microsoft Programming
Tags: ASP.Net : C#
Sign Up Now!
Solution Provided By: talker2004
Participating Experts: 2
Solution Grade: B
 
[+][-]03/17/08 11:35 AM, ID: 21144814Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/17/08 11:51 AM, ID: 21144951Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/17/08 12:51 PM, ID: 21145496Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 / EE_QW_2_20070628