calendar popup not working in master page
-
am using visual studio 2005express edition asp.net using c# 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 is my code my main form i have 2 textboxs and 2 buttons to pick the date..for each button i have the script to cal the popup calendarwindow. <!-- <!--Begin var a="i"; function newWindow() { a="i"; mywindow=window.open('calendar.aspx','myname','resizable=no,width=400,height=300'); mywindow.location.href='calendar.aspx'; } function update(day) { if(a=="i") { document.getElementById('txtidate').innerText=day; } if(a=="p") { document.getElementById('txtipdate').innerText=day; } } function MyWindow() { a="p"; mywindow1=window.open('calendar.aspx','myname','resizable=no,width=400,height=300'); mywindow1.location.href='calendar.aspx'; } //End--> in the calendarpopup window i have one caledar control and one button the code for that is.. protected void cldrdate_SelectionChanged(object sender, EventArgs e) { txtdate.Text = cldrdate.SelectedDate.ToShortDateString(); Session["date"] = cldrdate.SelectedDate.ToShortDateString(); } protected void Button2_Click(object sender, EventArgs e) { var MyArgs =document.getElementById('txtdate').value; window.opener.update(MyArgs); window.close(); } it was working properly before using with the master pages.. hw can i do it with masterpages...plz help </x-turndown>
-
am using visual studio 2005express edition asp.net using c# 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 is my code my main form i have 2 textboxs and 2 buttons to pick the date..for each button i have the script to cal the popup calendarwindow. <!-- <!--Begin var a="i"; function newWindow() { a="i"; mywindow=window.open('calendar.aspx','myname','resizable=no,width=400,height=300'); mywindow.location.href='calendar.aspx'; } function update(day) { if(a=="i") { document.getElementById('txtidate').innerText=day; } if(a=="p") { document.getElementById('txtipdate').innerText=day; } } function MyWindow() { a="p"; mywindow1=window.open('calendar.aspx','myname','resizable=no,width=400,height=300'); mywindow1.location.href='calendar.aspx'; } //End--> in the calendarpopup window i have one caledar control and one button the code for that is.. protected void cldrdate_SelectionChanged(object sender, EventArgs e) { txtdate.Text = cldrdate.SelectedDate.ToShortDateString(); Session["date"] = cldrdate.SelectedDate.ToShortDateString(); } protected void Button2_Click(object sender, EventArgs e) { var MyArgs =document.getElementById('txtdate').value; window.opener.update(MyArgs); window.close(); } it was working properly before using with the master pages.. hw can i do it with masterpages...plz help </x-turndown>
http://michaelsync.net/2006/11/06/aspnet-calendar-control-and-yahoouicalendar/
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
am using visual studio 2005express edition asp.net using c# 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 is my code my main form i have 2 textboxs and 2 buttons to pick the date..for each button i have the script to cal the popup calendarwindow. <!-- <!--Begin var a="i"; function newWindow() { a="i"; mywindow=window.open('calendar.aspx','myname','resizable=no,width=400,height=300'); mywindow.location.href='calendar.aspx'; } function update(day) { if(a=="i") { document.getElementById('txtidate').innerText=day; } if(a=="p") { document.getElementById('txtipdate').innerText=day; } } function MyWindow() { a="p"; mywindow1=window.open('calendar.aspx','myname','resizable=no,width=400,height=300'); mywindow1.location.href='calendar.aspx'; } //End--> in the calendarpopup window i have one caledar control and one button the code for that is.. protected void cldrdate_SelectionChanged(object sender, EventArgs e) { txtdate.Text = cldrdate.SelectedDate.ToShortDateString(); Session["date"] = cldrdate.SelectedDate.ToShortDateString(); } protected void Button2_Click(object sender, EventArgs e) { var MyArgs =document.getElementById('txtdate').value; window.opener.update(MyArgs); window.close(); } it was working properly before using with the master pages.. hw can i do it with masterpages...plz help </x-turndown>
Where have u coded javascript function? In master page or in content page? Best regard Pathan
GOD HELP THOSE WHO HELP THEMSELVES
-
Where have u coded javascript function? In master page or in content page? Best regard Pathan
GOD HELP THOSE WHO HELP THEMSELVES
-
am using visual studio 2005express edition asp.net using c# 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 is my code my main form i have 2 textboxs and 2 buttons to pick the date..for each button i have the script to cal the popup calendarwindow. <!-- <!--Begin var a="i"; function newWindow() { a="i"; mywindow=window.open('calendar.aspx','myname','resizable=no,width=400,height=300'); mywindow.location.href='calendar.aspx'; } function update(day) { if(a=="i") { document.getElementById('txtidate').innerText=day; } if(a=="p") { document.getElementById('txtipdate').innerText=day; } } function MyWindow() { a="p"; mywindow1=window.open('calendar.aspx','myname','resizable=no,width=400,height=300'); mywindow1.location.href='calendar.aspx'; } //End--> in the calendarpopup window i have one caledar control and one button the code for that is.. protected void cldrdate_SelectionChanged(object sender, EventArgs e) { txtdate.Text = cldrdate.SelectedDate.ToShortDateString(); Session["date"] = cldrdate.SelectedDate.ToShortDateString(); } protected void Button2_Click(object sender, EventArgs e) { var MyArgs =document.getElementById('txtdate').value; window.opener.update(MyArgs); window.close(); } it was working properly before using with the master pages.. hw can i do it with masterpages...plz help </x-turndown>
try to open viewsource and locate the id from (getElementbyid) you'll notice that its changed due to contentpage which something that asp.net do copy that id and replace it with foormal id and try it , it should work.