PC Review


Reply
Thread Tools Rate Thread

Cross Page Posting using public property on previous page

 
 
=?Utf-8?B?dGhlV2l6YXJkMQ==?=
Guest
Posts: n/a
 
      20th Apr 2006
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.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?dGhlV2l6YXJkMQ==?=
Guest
Posts: n/a
 
      20th Apr 2006
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.
>
>

 
Reply With Quote
 
Swanand Mokashi
Guest
Posts: n/a
 
      20th Apr 2006
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" <(E-Mail Removed)> wrote in message
news:301E82A3-10F3-4F17-8327-(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do you return to the previous page on cross page postback? YankeeImperialistDog Microsoft ASP .NET 3 28th Apr 2009 04:48 PM
Making a public property on a master page visible to a content page Ex glider pilot Microsoft ASP .NET 1 25th May 2008 07:12 PM
view state in previous page using cross page postback bill Microsoft ASP .NET 6 17th Feb 2006 08:32 PM
How do I do cross page posting from a master page? Alan Silver Microsoft ASP .NET 4 22nd Jan 2006 11:01 AM
Cross page posting with Master page =?Utf-8?B?QXR1bCBCYWhs?= Microsoft ASP .NET 5 26th Jul 2005 02:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:01 PM.