C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




javascript


Posted Date: 05 Sep 2008      Total Responses: 5

Posted By: suze       Member Level: Gold     Points: 1


Hi all
The page "calender" is not get opened.
Thatz d problem
waiting for localhost then read localhost after that same page is displaying which i placed the open button

plz help


Ref:
I want to open a page in new window i got a code but it is not working
pls check d code

<script type="text/javascript">
function openWindow() //open_win()
{
//window.open("http://www.aceproject.com");
window.showModalDialog("calender.aspx",'','');
}
</script>
<form>

<input type="Submit" value="Open" id="Submit1" onclick="openWindow()";/>
// <input type=button value="Open Window" onclick="open_win()">
</form>




Responses

Author: Priya    05 Sep 2008Member Level: SilverRating:     Points: 1
Check if you have any response.redirect to the parent page in your calendar.aspx page. This may bring you back to the parent page.


Author: suze    05 Sep 2008Member Level: GoldRating:     Points: 1
No Response.redirect


Author: Avadhesh Kumar Tiwari    05 Sep 2008Member Level: SilverRating:     Points: 2
You should use string builder class..
example....
add namespace on your .CS page
using System.text;

StringBuilder sb=new StringBuilder();
sb.Append("<Script>");
sb.Append("Window.Open("Calender");
Sb.Append(</Script>");

Hope this code will help you..





Author: Priya    05 Sep 2008Member Level: SilverRating:     Points: 2
Add this code on page_load()

Submit1.attributes.add("onClick","javascript:window.open('calender.aspx','null','height=300,width=400,status=yes,toolbar=no,menubar=no,location=no');")




Author: Kundan Kumar Sinha    05 Sep 2008Member Level: GoldRating:     Points: 3
Hi Soja,

In the given code, you are calling the function on click event of submit button. so your page is getting submitted.

Use the following code.

<script type="text/javascript">
function openWindow() //open_win()
{
//window.open("http://www.aceproject.com");
window.showModalDialog("calender.aspx",'','');
}
</script>
<form>

<input type="button" value="Open" id="Submit1" onclick="openWindow()";/>
// <input type=button value="Open Window" onclick="open_win()">
</form>

Regards,
Kundan



Post Reply
You must Sign In to post a response.
Next : Urgent Issue - DNN
Previous : what is the maximum capasity of session,cookies and query string???
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use