473,385 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Cross Page Posting using public property on previous page

Using Visual Studio.Net 2005, Asp.Net 2.0, and trying to use technique shown
in the Programming Asp.Net 3rd Edition by O'Reily, page 257.

On the first page, this would become the previous page, I have 2 dropdowns.
According to their technique, I should create a public property on my
previous page for these 2 dropdowns, and then I would would be able to get
their settings on the target aspx page.

I have added the 2 properties on the previous page:

public DropDownList ddlMonth
{
get { return ddlMonth; }
}

public DropDownList ddlYear
{
get { return ddlYear; }
}

However, I get an errors showing:
The type "gives me my page name" already contains a definition for ddlMonth.
The type "gives me my page name" already contains a definition for ddlYear.

I would really like to use this technique. Please help.
Apr 20 '06 #1
2 2390
Further info regarding my previous page:

It contains these 2 methods:

protected void ddlMonth_SelectedIndexChanged(object sender, EventArgs e)
{

}
protected void ddlYear_SelectedIndexChanged(object sender, EventArgs e)
{

}

Do I need to make these public? Is this causing any conflicts?

Please any assistance regarding how to use the public property get for
controls when using Cross Page Posting, or Response.Redirect or
Server.Transfer would be appreciated. I preferred using the property get
because it avoid having to pass anything on a querystring, or having to have
a hidden field.

"theWizard1" wrote:
Using Visual Studio.Net 2005, Asp.Net 2.0, and trying to use technique shown
in the Programming Asp.Net 3rd Edition by O'Reily, page 257.

On the first page, this would become the previous page, I have 2 dropdowns.
According to their technique, I should create a public property on my
previous page for these 2 dropdowns, and then I would would be able to get
their settings on the target aspx page.

I have added the 2 properties on the previous page:

public DropDownList ddlMonth
{
get { return ddlMonth; }
}

public DropDownList ddlYear
{
get { return ddlYear; }
}

However, I get an errors showing:
The type "gives me my page name" already contains a definition for ddlMonth.
The type "gives me my page name" already contains a definition for ddlYear.

I would really like to use this technique. Please help.

Apr 20 '06 #2
If the property is the same as the name of the dropdownlist , the compiler
is going to complain.

Your [PageName].aspx.designer.cs class will have the dropdownlist defined,
if you want to expose the ddl as a property simply
use a different name

Hope this helps!
Swanand
--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services

"theWizard1" <th********@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
Using Visual Studio.Net 2005, Asp.Net 2.0, and trying to use technique
shown
in the Programming Asp.Net 3rd Edition by O'Reily, page 257.

On the first page, this would become the previous page, I have 2
dropdowns.
According to their technique, I should create a public property on my
previous page for these 2 dropdowns, and then I would would be able to get
their settings on the target aspx page.

I have added the 2 properties on the previous page:

public DropDownList ddlMonth
{
get { return ddlMonth; }
}

public DropDownList ddlYear
{
get { return ddlYear; }
}

However, I get an errors showing:
The type "gives me my page name" already contains a definition for
ddlMonth.
The type "gives me my page name" already contains a definition for
ddlYear.

I would really like to use this technique. Please help.

Apr 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Arun Nair | last post by:
Hi, I have the following jsp page. I am able to view only a part of it(until the occurence of the first City text box). If i remove the first few fields from the page, I am able to see a few...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
12
by: Rudy | last post by:
Hi, I need to make a request to a asp.net page using HttpWebRequest class and I need to trick this page into thinking it's a postback and a button was clicked. But the page doesn't handle the...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
5
by: Bryan | last post by:
I am trying to get to a label control to get its Text value. from a previous page. The label control is buried in a Web User Control that is in a webpart zone. When I use this code:...
6
by: bill | last post by:
Is there a way to retrieve values from the viewstate in the previouspage using cross page postback? Thanks! Bill
2
by: deshg | last post by:
Hey everyone, I am a php programmer originally and am just helping a friend of mine update their website that they paid a designer (well that's what he called himself!) to do ages ago. I have...
1
by: ArunDhaJ | last post by:
Hi, I'm in need of help for solving the following problem: I've a page with two div tag as follows: <div id="divNormalView" runat="server"> <asp:listbox id="listSelectedMembers"...
8
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I the page knows there was a cross post back. but i can not find the control. (asp.net 3.5) calling page has a master calling control: <asp:Button ID="btnSendAlert" runat="server" Text="Go"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.