Page.RegisterStartupScript
-
Hi guys, Very good morning to all..., i have a page in tht one image click i opened a pop up window..., while openeing the popup window i have checked the session of "userid"..., if session is expired i have to close the popup window and the parent page has to redirect to login page..., so the popup window page i have declared in page load like this..., _UserID = Session["UserID"] == null ? string.Empty : Session["UserID"].ToString().Trim(); if (_UserID == string.Empty) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(""); sb.Append("window.opener.location.href='/LoginPT.aspx?msg=se"); sb.Append("';"); sb.Append("self.close();"); sb.Append(""); Page.RegisterStartupScript("FocusScript", sb.ToString()); } but this is not working for me..., plz guide me to solve this..., Thanks & Regards, Member 3879881, please don't forget to vote on the post
-
Hi guys, Very good morning to all..., i have a page in tht one image click i opened a pop up window..., while openeing the popup window i have checked the session of "userid"..., if session is expired i have to close the popup window and the parent page has to redirect to login page..., so the popup window page i have declared in page load like this..., _UserID = Session["UserID"] == null ? string.Empty : Session["UserID"].ToString().Trim(); if (_UserID == string.Empty) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(""); sb.Append("window.opener.location.href='/LoginPT.aspx?msg=se"); sb.Append("';"); sb.Append("self.close();"); sb.Append(""); Page.RegisterStartupScript("FocusScript", sb.ToString()); } but this is not working for me..., plz guide me to solve this..., Thanks & Regards, Member 3879881, please don't forget to vote on the post
Do you have script manager on the page ?
Cheers ! Abhijit Jana | My Blog | @Twitter | Disclaimer
:bob: Indian CodeProject Members Meet 2010 - Nominate Now :bob:
-
Hi guys, Very good morning to all..., i have a page in tht one image click i opened a pop up window..., while openeing the popup window i have checked the session of "userid"..., if session is expired i have to close the popup window and the parent page has to redirect to login page..., so the popup window page i have declared in page load like this..., _UserID = Session["UserID"] == null ? string.Empty : Session["UserID"].ToString().Trim(); if (_UserID == string.Empty) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(""); sb.Append("window.opener.location.href='/LoginPT.aspx?msg=se"); sb.Append("';"); sb.Append("self.close();"); sb.Append(""); Page.RegisterStartupScript("FocusScript", sb.ToString()); } but this is not working for me..., plz guide me to solve this..., Thanks & Regards, Member 3879881, please don't forget to vote on the post
Have you debugged it? Is the if condition being meet? Is the script being written and just not executed?
I know the language. I've read a book. - _Madmatt
-
Do you have script manager on the page ?
Cheers ! Abhijit Jana | My Blog | @Twitter | Disclaimer
:bob: Indian CodeProject Members Meet 2010 - Nominate Now :bob:
ScriptManager is irrelevant. It is for AJAX support and is not necessary for injecting normal JavaScript into a page.
I know the language. I've read a book. - _Madmatt
-
ScriptManager is irrelevant. It is for AJAX support and is not necessary for injecting normal JavaScript into a page.
I know the language. I've read a book. - _Madmatt
Mark Nischalke wrote:
ScriptManager is irrelevant.
I was asking becasue, If he has ScriptManager on the page, then the code he has written won't work.
Mark Nischalke wrote:
It is for AJAX support and is not necessary for injecting normal JavaScript into a page.
:)
Cheers ! Abhijit Jana | My Blog | @Twitter | Disclaimer
:bob: Indian CodeProject Members Meet 2010 - Nominate Now :bob: