473,395 Members | 1,972 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,395 software developers and data experts.

Problem using Master & Content pages with Calendar pop-up

I have a simple project where there is a master page called
MasterPage.master and some webforms which are content pages. I also
have a usercontrol which is a simple calendar control popup.
The folder structure is as follows:

Test Folder
Test.aspx (normal webform)
Test2.aspx (content page)

ctlCalendar.ascx
Default.aspx (normal webform)
Default2.aspx (content page)
MasterPage.master
Web.Config

Both Test.apsx and Test2.aspx use the calendar control.
Default.aspx redirects to Test.aspx and Default2.aspx redirect to
Test2.aspx.

The problem I'm having is that when I set Default.aspx as the startup
page, the calendar control works fine.

When I use Default2.aspx (content page) as the start up I get an error

Error: 'CtlCalendar1_pnlCalendar' is undefined

in the explorer status bar.

ctlCalendar Code is as follows:

private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
this.TextBox1.Text = System.DateTime.Now.ToShortDateString();
this.pnlCalendar.Attributes.Add("style","DISPLAY: none; POSITION:
absolute");
}
else
{
string id =
Page.Request.Form["__EVENTTARGET"].Substring(0,Page.Request.Form["__EVENTTARGET"].IndexOf(":"));
if (id != this.ID)
this.pnlCalendar.Attributes.Add("style","DISPLAY: none; POSITION:
absolute");
else
this.pnlCalendar.Attributes.Add("style","POSITION: absolute");
}
Page.RegisterClientScriptBlock("Script_Panel" + this.ID, "<script>
function On"+this.ID+"Click() { if("+this.ID
+"_pnlCalendar.style.display == \"none\") "+this.ID
+"_pnlCalendar.style.display = \"\"; else "+this.ID
+"_pnlCalendar.style.display = \"none\"; } </script>");

this.Button1.Attributes.Add("OnClick","On"+this.ID +"Click()");
}

private void Calendar1_SelectionChanged(object sender,
System.EventArgs e)
{
this.TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();
this.pnlCalendar.Attributes.Add("style","DISPLAY: none; POSITION:
absolute");
}

Aug 28 '07 #1
0 1623

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

Similar topics

1
by: Sasha | last post by:
Hi all asp.net proffesionals out there, How do you implement master pages in your applications? What libraries do you use and what have been your experience? Sasha
7
by: Martijn Saly | last post by:
Hi there, I've created a master page with some controls on it, a Calendar control among others. Now depending on the date(s) selected, the content page needs to be updated. In the masterpage...
0
by: Nick Stansbury | last post by:
I'm experiencing a weird problem with master pages in VS 2005 - in short when the master page is open in design view in visual studio all other webforms that use that master display correctly when...
0
by: newsgroups.jd | last post by:
Looking for some options and suggestions on how to proceed - any advice is appreciated and thank you in advance... I have created a master page that has multiple dropdownlists and calendar and...
0
by: newsgroups.jd | last post by:
Looking for some options and suggestions on how to proceed - any advice is appreciated and thank you in advance... I have created a master page that has multiple dropdownlists and calendar and...
6
by: Murray Hopkins | last post by:
Hi. THE QUESTION: How do I get a reference to my Object when processing an event handler bound to an html element ? CONTEXT: Sorry if it is a bit long. I am developing a JS calendar tool....
0
by: dixonjm | last post by:
Hi, I have a master page & various pages that will use this master page. Each content page will have a CSS & JS file which will be named the same as the content page. When I try to load the CSS...
1
by: sudip2008 | last post by:
When using the Calendar Popup in a content page of a masterpage the strForName is always set to aspnetForm This breaks this line from working properly window.opener.document.forms...... How can...
5
by: smittie31 | last post by:
I am having a problem with a border around me html page. The border does not flow thru the whole html page, it cuts off halfway. --> See http://keithborom.com/marlon-sanders CSS STYLESHEET ...
2
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
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,...

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.