Returning value to the main page from the popup page
-
Hi, I have a textbox in the main page and a image control. Onclicking on the image one popup window is opening where there is a calendar control. On double clicking on the date it should come in the textbox of the main page. How can i do that.
Thanks & Regards Mishra
-
Hi, I have a textbox in the main page and a image control. Onclicking on the image one popup window is opening where there is a calendar control. On double clicking on the date it should come in the textbox of the main page. How can i do that.
Thanks & Regards Mishra
Use javascript function: On calender Selection changed do this control.Value = calDate.SelectedDate.ToShortDateString(); Response.Write("window.returnValue='" + calDate.SelectedDate.ToString("dd/MM/yyyy") + "';window.close();");
-
Hi, I have a textbox in the main page and a image control. Onclicking on the image one popup window is opening where there is a calendar control. On double clicking on the date it should come in the textbox of the main page. How can i do that.
Thanks & Regards Mishra
PASS TEXT BOX ID TO POPUP WINDOW.
Function calendar(ID) { window.open("calendar.aspx?ID="+ID,......,.......,........); }
NOW IN CALENDAR.ASPX.CS PAGE,WRITE BELOVE CODE TO GET SELECTED DATE ON SELECTIONCHANGED EVENTprotected void Calendar1_SelectionChanged(object sender, EventArgs e) { Response.Write("opener.document.getElementById('"+Request.Qeurystring["ID"]+"').value='" + Calendar1.SelectedDate.ToShortDateString() + "'; self.close();"); }
yOU WILL GET SELECTED DATE IN TEXTBOX. PLZ VOTE IF THIS POST WILL BE HELPFUL bEST rEGARD pATHAN---------------------------------------------------
-
PASS TEXT BOX ID TO POPUP WINDOW.
Function calendar(ID) { window.open("calendar.aspx?ID="+ID,......,.......,........); }
NOW IN CALENDAR.ASPX.CS PAGE,WRITE BELOVE CODE TO GET SELECTED DATE ON SELECTIONCHANGED EVENTprotected void Calendar1_SelectionChanged(object sender, EventArgs e) { Response.Write("opener.document.getElementById('"+Request.Qeurystring["ID"]+"').value='" + Calendar1.SelectedDate.ToShortDateString() + "'; self.close();"); }
yOU WILL GET SELECTED DATE IN TEXTBOX. PLZ VOTE IF THIS POST WILL BE HELPFUL bEST rEGARD pATHAN---------------------------------------------------
-
PASS TEXT BOX ID TO POPUP WINDOW.
Function calendar(ID) { window.open("calendar.aspx?ID="+ID,......,.......,........); }
NOW IN CALENDAR.ASPX.CS PAGE,WRITE BELOVE CODE TO GET SELECTED DATE ON SELECTIONCHANGED EVENTprotected void Calendar1_SelectionChanged(object sender, EventArgs e) { Response.Write("opener.document.getElementById('"+Request.Qeurystring["ID"]+"').value='" + Calendar1.SelectedDate.ToShortDateString() + "'; self.close();"); }
yOU WILL GET SELECTED DATE IN TEXTBOX. PLZ VOTE IF THIS POST WILL BE HELPFUL bEST rEGARD pATHAN---------------------------------------------------
Imran Khan Pathan wrote:
Response.Write("opener.document.getElementById('"+Request.Qeurystring["ID"]+"').value='" + Calendar1.SelectedDate.ToShortDateString() + "'; self.close();");
It isn't good practice to use Response.Write to inject Javascrip code into your ASP.NET web page. Use the functionality exposed by the Page.ClientScript object. Regards Paul