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. 2 2404
Further info regarding my previous page:
It contains these 2 methods:
protected void ddlMonth_Select edIndexChanged( object sender, EventArgs e)
{
}
protected void ddlYear_Selecte dIndexChanged(o bject 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.Redire ct 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.
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********@dis cussions.micros oft.com> wrote in message
news:30******** *************** ***********@mic rosoft.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.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 more fields at
the bottom.
My form class contains all the properties that are used in the jsp
page.
I don't know what I am doing wrong. I am using...
|
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 courses are
populated. When course is selected, lists of occurrences, groups and
|
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 click event,
despite I'm using "POST" method and sending all the form fields
(except of __VIEWSTATE, may this be the reason ?).
So the question is:...
|
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 button will verify the information that has been entered and
updates the data base if the data is correct. Update will throw an exception
if the data is...
|
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:
foreach(Control c in PreviousPage.Controls)
{
and try to find the control here.
}
| |
by: bill |
last post by:
Is there a way to retrieve values from the viewstate in the previouspage
using cross page postback?
Thanks!
Bill
|
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 built the whole site (ASP.NET using VB.NET) but am having problems on the most basic thing! I have a page which querys an MS SQL database and takes url...
|
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" Runat="server"</
asp:listbox>
</div>
<div id="divPrintPreview" runat="server">
<asp:datagrid>
|
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"
onclick="btnSendAlert_Click" PostBackUrl="ItemUpLoadAdmin.aspx"
CommandArgument="5" />
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |