User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 423,435 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,694 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 1306 | Replies: 14
Reply
Join Date: Jun 2007
Posts: 13
Reputation: rocket1356 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
rocket1356 rocket1356 is offline Offline
Newbie Poster

Open form in the same window

  #1  
May 21st, 2008
I am trying to open another page from an image. I can open the page on a different window by doing this: onclick="Response.Redirect(cci_info\cci\features\create_CCI\WebForm1.aspx);"

But I don't want to open another window, rather I need the image button to open a page in the same window.

Thanks for the help.

  1. <asp:image imageurl="~/common/images/demos/header-buildsummary.png" width="125" height="34" alternatetext="CCI Form" runat="server" cssclass="site"
  2. id="cciform" onmouseover="this.src='common/images/demos/header-cciform-hover.png';"
  3. onmouseout="this.src='common/images/demos/header-cciform.png';"
  4. onclick="Response.Redirect(cci_info\cci\features\create_CCI\WebForm1.aspx);" title="Test - CCI"TabIndex="1"/>
Last edited by peter_budo : May 24th, 2008 at 7:14 pm. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is online now Online
Veteran Poster

Re: Open form in the same window

  #2  
May 21st, 2008
You want the image button to open the page in the same window (i.e. without launching a new IE browser?)?
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Jun 2007
Posts: 13
Reputation: rocket1356 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
rocket1356 rocket1356 is offline Offline
Newbie Poster

Re: Open form in the same window

  #3  
May 21st, 2008
Correct. Just like if you click on the"IRC Chat Network" image to the right of you screen. It will open the link on the same window.
Reply With Quote  
Join Date: Jun 2007
Posts: 13
Reputation: rocket1356 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
rocket1356 rocket1356 is offline Offline
Newbie Poster

Re: Open form in the same window

  #4  
May 21st, 2008
Originally Posted by majestic0110 View Post
You want the image button to open the page in the same window (i.e. without launching a new IE browser?)?



I messed up on the problem detail. I was able to open up another form but in a new window by doing this:

onclick="window.open('WebForm/UCOSQA','_blank');"

But I just want to open the form on the same window. The above window.open will open another window.
Last edited by peter_budo : May 24th, 2008 at 7:15 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is online now Online
Veteran Poster

Re: Open form in the same window

  #5  
May 21st, 2008
  1. onclick="Response.Redirect(pagetogoto.aspx);"

Should do the trick. If not let me know and post your code. Hope that helps!
Last edited by majestic0110 : May 21st, 2008 at 3:37 pm.
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Jun 2007
Posts: 13
Reputation: rocket1356 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
rocket1356 rocket1356 is offline Offline
Newbie Poster

Re: Open form in the same window

  #6  
May 21st, 2008
Originally Posted by majestic0110 View Post
  1. onclick="Response.Redirect(pagetogoto.aspx);"

Should do the trick. If not let me know and post your code. Hope that helps!



I tried that but got no response from clicking.
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is online now Online
Veteran Poster

Re: Open form in the same window

  #7  
May 21st, 2008
Show me the complete code, it may be a slight error somewhere. That should work.
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is online now Online
Veteran Poster

Re: Open form in the same window

  #8  
May 21st, 2008
Actually, create an event handler for the image (by double clicking it in Visual studio) then in the event handler try this:

  1. Response.Redirect("pagetogoto.aspx");

Or for Visual Basic

  1. Response.Redirect("pagetogoto.aspx")

This should fix it. Hope this helps!
Last edited by majestic0110 : May 21st, 2008 at 4:21 pm.
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Join Date: Jun 2007
Posts: 13
Reputation: rocket1356 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
rocket1356 rocket1356 is offline Offline
Newbie Poster

Re: Open form in the same window

  #9  
May 21st, 2008
Originally Posted by majestic0110 View Post
Actually, create an event handler for the image (by double clicking it in Visual studio) then in the event handler try this:

  1. Response.Redirect("pagetogoto.aspx");

Or for Visual Basic

  1. Response.Redirect("pagetogoto.aspx")

This should fix it. Hope this helps!




  1. <%@ Page Language ="C#"%>
  2. <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4.  
  5. <script runat="server">
  6.  
  7.  
  8. </script>
  9.  
  10. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  11. <head id="Head1" runat="server">
  12. <title>UCOSQA - Home</title>
  13. <link href="common/css/rotator.css" type="text/css" rel="stylesheet" />
  14. <link rel="stylesheet" type="text/css" href="common/css/demos.css" />
  15. <!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="common/css/ie6-demos.css" /><![endif]-->
  16. </head>
  17. <body>
  18. <form id="form1" runat="server">
  19. <!-- Body Container -->
  20. <div id="body-container">
  21.  
  22. <!-- Header Container -->
  23. <div id="header-container">
  24.  
  25. <!-- Header Navigation -->
  26. <div id="header">
  27. <asp:image imageurl="~/common/images/demos/header-logo.png" width="121" height="34" alternatetext="ComponentArt" runat="server" cssclass="logo" id="ca_logo" />
  28. <asp:image imageurl="~/common/images/demos/header-divider.png" width="35" height="34" alternatetext="|" runat="server" cssclass="divider" id="divider" />
  29. <asp:image imageurl="~/common/images/demos/header-title.png" width="188" height="34" alternatetext="Web.UI 2007.1 Live Demos" runat="server" cssclass="demo-title" id="demo_title" />
  30. <asp:image imageurl="~/common/images/navigation/separator.png" width="353px"
  31. height="34px" alternatetext=" " runat="server" cssclass="separator"
  32. id="separator" />
  33. <asp:image imageurl="~/common/images/demos/header-buildsummary.png" width="125"
  34. height="34" alternatetext="UCOS QA - Build Summary" runat="server"
  35. cssclass="site" id="buildsummary"
  36. onmouseover="this.src='common/images/demos/header-buildsummary-hover.png';"
  37. onmouseout="this.src='common/images/demos/header-buildsummary.png';"
  38. onclick="window.open('WebForm/UCOSQA','_blank');" title="UCOSQA - Build Summary" />
  39. <asp:image imageurl="~/common/images/demos/header-cciform.png" width="125"
  40. height="34" alternatetext="CCI Form" runat="server" cssclass="site"
  41. id="cciform"
  42. onmouseover="this.src='common/images/demos/header-cciform-hover.png';"
  43. onmouseout="this.src='common/images/demos/header-cciform.png';"
  44. onclick="Response.Redirect(copyofdefault.aspx);" title="UCOSQA - CCI Form"
  45. TabIndex="1"/>
  46. </div>
Last edited by peter_budo : May 24th, 2008 at 7:15 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,124
Reputation: majestic0110 is on a distinguished road 
Rep Power: 3
Solved Threads: 47
majestic0110's Avatar
majestic0110 majestic0110 is online now Online
Veteran Poster

Re: Open form in the same window

  #10  
May 21st, 2008
Did you try what I suggested in post 8 - it should work !
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 2:19 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC