Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 17, 2012 07:32 PM by mjocasio
Member
58 Points
70 Posts
Jan 17, 2012 02:55 PM|LINK
How do I open an aspx page using window.open function replacing existing window. I try _self as an argument and it does not recognize it; if I do not used any parameter except the name of the aspx page; it opens new window which I do not one......
Contributor
5744 Points
1036 Posts
Jan 17, 2012 03:46 PM|LINK
try this
window.location.href = "blahblah.aspx";
Jan 17, 2012 04:51 PM|LINK
This will open a new window which I don't want. i want touse the current window I have open.... I try
windows.open('asdasda.aspx','_self')
bu if I do windows.open('asaass.aspx') it will open the page in a new window..... I want to be able to replace the current one...
Jan 17, 2012 04:54 PM|LINK
this will not open a new window. This will change the url of existing window. you dont have to use window.open()/
Jan 17, 2012 04:59 PM|LINK
I get an exception when I try to execute the above statement in a java script block......
Jan 17, 2012 05:02 PM|LINK
What is the exception?
Jan 17, 2012 05:05 PM|LINK
It is implying that href is null or not an object........
Jan 17, 2012 05:07 PM|LINK
provide the code please
Jan 17, 2012 05:08 PM|LINK
script type="text/javascript">
function SurveyBtn_onclick(flag)
{
if (flag) {window.href.location = "DefineSurvey.aspx"};
else {window.href.location = "CreateSurvey.aspx";}
}
Jan 17, 2012 05:10 PM|LINK
MyBad..
its window.location.href not window.href.location.. sorry!
so it must be:
if (flag) {window.location.href = "DefineSurvey.aspx"};
else {window.location.href = "CreateSurvey.aspx";}
mjocasio
Member
58 Points
70 Posts
Simple question
Jan 17, 2012 02:55 PM|LINK
How do I open an aspx page using window.open function replacing existing window. I try _self as an argument and it does not recognize it; if I do not used any parameter except the name of the aspx page; it opens new window which I do not one......
nobdy
Contributor
5744 Points
1036 Posts
Re: Simple question
Jan 17, 2012 03:46 PM|LINK
try this
window.location.href = "blahblah.aspx";
My Blog | My Website
mjocasio
Member
58 Points
70 Posts
Re: Simple question
Jan 17, 2012 04:51 PM|LINK
This will open a new window which I don't want. i want touse the current window I have open.... I try
windows.open('asdasda.aspx','_self')
bu if I do windows.open('asaass.aspx') it will open the page in a new window..... I want to be able to replace the current one...
nobdy
Contributor
5744 Points
1036 Posts
Re: Simple question
Jan 17, 2012 04:54 PM|LINK
window.location.href = "blahblah.aspx";
</div>this will not open a new window. This will change the url of existing window. you dont have to use window.open()/
My Blog | My Website
mjocasio
Member
58 Points
70 Posts
Re: Simple question
Jan 17, 2012 04:59 PM|LINK
I get an exception when I try to execute the above statement in a java script block......
nobdy
Contributor
5744 Points
1036 Posts
Re: Simple question
Jan 17, 2012 05:02 PM|LINK
What is the exception?
My Blog | My Website
mjocasio
Member
58 Points
70 Posts
Re: Simple question
Jan 17, 2012 05:05 PM|LINK
It is implying that href is null or not an object........
nobdy
Contributor
5744 Points
1036 Posts
Re: Simple question
Jan 17, 2012 05:07 PM|LINK
provide the code please
My Blog | My Website
mjocasio
Member
58 Points
70 Posts
Re: Simple question
Jan 17, 2012 05:08 PM|LINK
script type="text/javascript">
function SurveyBtn_onclick(flag)
{
if (flag) {window.href.location = "DefineSurvey.aspx"};
else {window.href.location = "CreateSurvey.aspx";}
}
nobdy
Contributor
5744 Points
1036 Posts
Re: Simple question
Jan 17, 2012 05:10 PM|LINK
MyBad..
its window.location.href not window.href.location.. sorry!
so it must be:
function SurveyBtn_onclick(flag)
{
if (flag) {window.location.href = "DefineSurvey.aspx"};
else {window.location.href = "CreateSurvey.aspx";}
}
My Blog | My Website