Well, calendar.aspx will never be able to see the textbox because it is on a
different page.
I would suggest not having the pages talk to each other but rather pass
whatever information you need via the querystring or using JavaScript. If
you use something like showModalDialog, then you can even pass information
back to the page that opened the calendar.
"Samy" <> wrote in message
news: oups.com...
> Hi There,
> I have a user control with a textbox and a button which when clicked
> opens a calendar control(calendar.aspx page). When I select a date from
> the calendar control, the date is supposed to be populated in the
> textbox. I use the user control on a index.aspx page.
> In order to achieve this I have a selected intexchange event on the
> calendar control. I pass the textbox id using the querystring when the
> button is clicked and then retrieve that using a
> htmlhiddeniput(id:control) variable on the calendar.aspx page.
>
> if(this.Request["textbox"] !=null)
> control.Value = Request.QueryString["textbox"].ToString();
>
> _startDateCalendar_Dialog.Attributes["onclick"] = "var w =
> window.open('Calendar.aspx?textbox="+this.ID+"_arg ument3Value_Txt','cal','width=200,height=200,left= 270,top=80');w.focus();return
> false;";
>
> For some reason if I say window.opener.document.forms(0)." +
> control.Value + ".value = '";
> I get a JScript error saying object null or not defined.
> Becuase .net runtime cannot see the name of the textbox on the
> usercontrol, I use the syntax...this.ID +"_argument3Value_Txt' to
> idenify the textbox on the user control,
> which I pass it to the calendar page. ID refers to the id of the user
> control.
>
> Can anybody get back to me please as to why I am getting this error?
>
> Thanks a lot.
>
|