|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Return Values from Popup to UserControlCan anyone tell me please how can I return values from a popup to a UserControl. I use the same "method" like to return to a WebForm, but it not works in UserControl case. I have this code to return from popup to webform: ------------------------------------------------------------------------ sbScript.Append("<script language='javascript'>") sbScript.Append(Environment.NewLine) sbScript.Append("window.opener.document.forms[0].elements['") sbScript.Append(Request.QueryString("srcA")) sbScript.Append("'].value = '") sbScript.Append(strYear) sbScript.Append("';") sbScript.Append(Environment.NewLine) sbScript.Append("window.opener.document.forms[0].elements['") sbScript.Append(Request.QueryString("srcM")) sbScript.Append("'].value = '") sbScript.Append(strMonth) sbScript.Append("';") sbScript.Append(Environment.NewLine) sbScript.Append("window.opener.document.forms[0].elements['") sbScript.Append(Request.QueryString("srcD")) sbScript.Append("'].value = '") sbScript.Append(strDay) sbScript.Append("';") sbScript.Append(Environment.NewLine) sbScript.Append("window.close();") sbScript.Append(Environment.NewLine) sbScript.Append("</script>") RegisterStartupScript("CloseDate", sbScript.ToString()) ------------------------------------------------------------------------ -- Programming ASP.NET with VB.NET Thank's (if you try to help me) Hope can help (if I try to help) ruca Hi,
ruca wrote: > Hi, Usually, when something works for a Page but not for a Control, it's an > > Can anyone tell me please how can I return values from a popup to a > UserControl. I use the same "method" like to return to a WebForm, but it not > works in UserControl case. ID problem. Be aware that when a control gets added to the page, all its children controls get a different ID from the one set using the ID attribute. This is to guarantee that all the IDs on the page are unique. Inspect your produced HTML code using view-source. The control's unique ID can be obtained on the server using myControl.ClientID. > I have this code to return from popup to webform: Deprecated. Use> ------------------------------------------------------------------------ > sbScript.Append("<script language='javascript'>") <script type="text/javascript"> instead. HTH, Laurent -- Laurent Bugnion, GalaSoft Software engineering: http://www.galasoft-LB.ch PhotoAlbum: http://www.galasoft-LB.ch/pictures Support children in Calcutta: http://www.calcutta-espoir.ch Hi,
But this control is used in many pages How can I specifief or pass the ID into my UserControl, since is this that opens my popup???? -- Show quoteHide quoteProgramming ASP.NET with VB.NET Thank's (if you try to help me) Hope can help (if I try to help) ruca "Laurent Bugnion" <galasoft***@bluewin.ch> escreveu na mensagem news:uokJgs3HHHA.3676@TK2MSFTNGP03.phx.gbl... > Hi, > > ruca wrote: >> Hi, >> >> Can anyone tell me please how can I return values from a popup to a >> UserControl. I use the same "method" like to return to a WebForm, but it >> not works in UserControl case. > > Usually, when something works for a Page but not for a Control, it's an ID > problem. Be aware that when a control gets added to the page, all its > children controls get a different ID from the one set using the ID > attribute. This is to guarantee that all the IDs on the page are unique. > > Inspect your produced HTML code using view-source. The control's unique ID > can be obtained on the server using myControl.ClientID. > >> I have this code to return from popup to webform: >> ------------------------------------------------------------------------ >> sbScript.Append("<script language='javascript'>") > > Deprecated. Use > > <script type="text/javascript"> > > instead. > > HTH, > Laurent > -- > Laurent Bugnion, GalaSoft > Software engineering: http://www.galasoft-LB.ch > PhotoAlbum: http://www.galasoft-LB.ch/pictures > Support children in Calcutta: http://www.calcutta-espoir.ch
Other interesting topics
No open/save prompt
How to get GridView row from DataKey? Wizard.FinishButtonClick - launch browser AND redirect Drop Down List issue themes Images Item has already been added. Key in dictionary can't remove listitem from ddl in loop data field - change true/false to Yes/No asp.net 2.0 site menu control (from navigation block) and IE 5 compatibility Parameter as web user control |
|||||||||||||||||||||||