473,320 Members | 2,035 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,320 software developers and data experts.

popup calendar when using Masterpage

Ali
i am using visual studio 2005 and I am trying to create a popup calender so
when a user click on a image on the main form, a calender will then popup,
the user will select a date and the date will then be passed back to the main
form and populate a textbox. it works fine. but when i used master page for
all my pages and i put the textbox inside the content , the calender pops up
but when i select the date nothing happens .. the textbox was not populated
with the selected date from the calender and the window was not closed.

here's code which popups the calendar:

<asp:Content ID="Content2" ContentPlaceHolderID="ContentColumn"
Runat="server">
<div>

<A
onclick="window.open('Calendar.aspx?textbox=txtDat e','cal','width=300,height=300,left=470,top=300')"
href="javascript:;"><asp:textbox id=txtDate runat="server"
ForeColor="Black" Width="88px"></asp:textbox>
<IMG src="images/SmallCalendar.gif" border="0"></A></div>
</asp:Content>

and here's the code for the calendar selection change:

Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Calendar1.SelectionChanged
Dim strjscript As String = "<script language=""javascript"">"
strjscript &= "window.opener." & _
HttpContext.Current.Request.QueryString("formname" ) & ".value
= '" & _
Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</scr" & "ipt>"
Literal1.Text = strjscript
End Sub
Nov 19 '05 #1
4 9989
I'm not sure this has anything to do with ASP.NET 2.0. You are saying that
the window containing the ASP.NET calendar does not post back or if it does,
whatever is passed back to that window isn't used by the browser. (The
browser doesn't know about ASP.NET. It just runs HTML and scripts.)
I recommend:
1. Using the debugger to confirm that your server side code is being
executed correctly.
2. Viewing the HTML output to that window. (Right click on the window and
select View Source) Determine what the HTML is and look for errors.

There are many third party date pickers available. Some are free. Some use a
popup that doesn't require a separate window which makes it faster than the
ASP.NET calendar (no post backs) and doesn't fail when there is a popup
blocker. It may be easier to use one. In fact, ASP.NET has a rich variety of
third party controls for most situations. You can find them at www.asp.net
Control Gallery, www.123aspx.com, and www.411asp.net. Mine is "Peter's Date
Package" (http://www.peterblum.com/datecontrols/home.aspx).

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Ali" <Al*@discussions.microsoft.com> wrote in message
news:17**********************************@microsof t.com...
i am using visual studio 2005 and I am trying to create a popup calender
so
when a user click on a image on the main form, a calender will then popup,
the user will select a date and the date will then be passed back to the
main
form and populate a textbox. it works fine. but when i used master page
for
all my pages and i put the textbox inside the content , the calender pops
up
but when i select the date nothing happens .. the textbox was not
populated
with the selected date from the calender and the window was not closed.

here's code which popups the calendar:

<asp:Content ID="Content2" ContentPlaceHolderID="ContentColumn"
Runat="server">
<div>

<A
onclick="window.open('Calendar.aspx?textbox=txtDat e','cal','width=300,height=300,left=470,top=300')"
href="javascript:;"><asp:textbox id=txtDate runat="server"
ForeColor="Black" Width="88px"></asp:textbox>
<IMG src="images/SmallCalendar.gif" border="0"></A></div>
</asp:Content>

and here's the code for the calendar selection change:

Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Calendar1.SelectionChanged
Dim strjscript As String = "<script language=""javascript"">"
strjscript &= "window.opener." & _
HttpContext.Current.Request.QueryString("formname" ) & ".value
= '" & _
Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</scr" & "ipt>"
Literal1.Text = strjscript
End Sub

Nov 19 '05 #2
Ali
Hi Peter,
Nothing wrong in my server side code ... it works properly. I tried it
without using the master page .. and it worked fine. This problem just occurs
when i use master page. so any help or suggestion will be greatly appreciated

"Peter Blum" wrote:
I'm not sure this has anything to do with ASP.NET 2.0. You are saying that
the window containing the ASP.NET calendar does not post back or if it does,
whatever is passed back to that window isn't used by the browser. (The
browser doesn't know about ASP.NET. It just runs HTML and scripts.)
I recommend:
1. Using the debugger to confirm that your server side code is being
executed correctly.
2. Viewing the HTML output to that window. (Right click on the window and
select View Source) Determine what the HTML is and look for errors.

There are many third party date pickers available. Some are free. Some use a
popup that doesn't require a separate window which makes it faster than the
ASP.NET calendar (no post backs) and doesn't fail when there is a popup
blocker. It may be easier to use one. In fact, ASP.NET has a rich variety of
third party controls for most situations. You can find them at www.asp.net
Control Gallery, www.123aspx.com, and www.411asp.net. Mine is "Peter's Date
Package" (http://www.peterblum.com/datecontrols/home.aspx).

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Ali" <Al*@discussions.microsoft.com> wrote in message
news:17**********************************@microsof t.com...
i am using visual studio 2005 and I am trying to create a popup calender
so
when a user click on a image on the main form, a calender will then popup,
the user will select a date and the date will then be passed back to the
main
form and populate a textbox. it works fine. but when i used master page
for
all my pages and i put the textbox inside the content , the calender pops
up
but when i select the date nothing happens .. the textbox was not
populated
with the selected date from the calender and the window was not closed.

here's code which popups the calendar:

<asp:Content ID="Content2" ContentPlaceHolderID="ContentColumn"
Runat="server">
<div>

<A
onclick="window.open('Calendar.aspx?textbox=txtDat e','cal','width=300,height=300,left=470,top=300')"
href="javascript:;"><asp:textbox id=txtDate runat="server"
ForeColor="Black" Width="88px"></asp:textbox>
<IMG src="images/SmallCalendar.gif" border="0"></A></div>
</asp:Content>

and here's the code for the calendar selection change:

Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Calendar1.SelectionChanged
Dim strjscript As String = "<script language=""javascript"">"
strjscript &= "window.opener." & _
HttpContext.Current.Request.QueryString("formname" ) & ".value
= '" & _
Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</scr" & "ipt>"
Literal1.Text = strjscript
End Sub


Nov 19 '05 #3
Hello Ali,

I have notice when using master pages and other container controls that
the runtime engine seems to change the names of the controls and adds
the '$' Character to them. You might want to view the rendered HTML
source sent to the browser and see if this is the case. Unfortunately,
I am not sure if there is anything to be done about it.

Nov 19 '05 #4
Ali
Thanx Shawn. My hat's off for you. That was the reason of my problem. I did
the change and it worked. Thanx again

"Shawn" wrote:
Hello Ali,

I have notice when using master pages and other container controls that
the runtime engine seems to change the names of the controls and adds
the '$' Character to them. You might want to view the rendered HTML
source sent to the browser and see if this is the case. Unfortunately,
I am not sure if there is anything to be done about it.

Nov 19 '05 #5

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

Similar topics

6
by: mkobus | last post by:
Im relatively new, so please be patient with me... I need to update a parent .aspx screen from a popup and close the popup. Normally I would use...
5
by: Merex | last post by:
Hello all, I want to use the Calendar control as a popup window. I would like each day's link to execute some javascript which would set the value of a textbox on the window which opened the...
1
by: Ali | last post by:
I am trying to create a popup calender so when a user click on a image on the main form, a calender will then popup, the user will select a date and the date will then be passed back to the main...
3
by: Chris | last post by:
I am trying to use a calendar popup to populate a date in a textbox. I am using the example described in this article: http://aspnet.4guysfromrolla.com/articles/030202-1.aspx However, this...
3
by: Peter | last post by:
Does anyone have an example of how you would do a popup window when a user clicks on a day number link in the ASP.NET Web Calendar control? I am trying to create an event calendar similar to how...
1
by: Garth Wells | last post by:
I found sample code that shows me how to implement a popup calendar, but I would like the calendar to popup at the lower right of the Input to which it's associated...the way Sharepoint popup...
0
by: GV | last post by:
Hi all, New to developing in VS 2005 ASP 2.0 Trying to have a easy pop calender for a button on a web page. I keep getting a error message in IE6 that says: Line 69 Char 3 Error:...
5
by: rockdale | last post by:
Hi, I tried to search web for an non-popup calendar control, (like javascript calendar) but could not find a good solution. Most solutions are popup another window and show the calendar, then...
4
by: ShyGuy | last post by:
A while back I had found a link to a popup calendar that had a small button that was placed to the right of any text box. By clicking on the icon and selecting a date the text box was updated with...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.