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 402,622 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 2,247 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: 1111 | 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

Re: Open form in the same window

  #11  
May 21st, 2008
Originally Posted by majestic0110 View Post
Did you try what I suggested in post 8 - it should work !


I did I added:

onclick="Response.Redirect(copyofdefault.aspx);"
I got no response from clicking the image.
Last edited by peter_budo : May 24th, 2008 at 7:16 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 offline Offline
Veteran Poster

Re: Open form in the same window

  #12  
May 21st, 2008
Did you put it in the event handler of the image button in the code behind file? I have tested it myself and got it working this end. It should look something like this:

  1. Partial Class _Default
  2. Inherits System.Web.UI.Page
  3.  
  4. Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
  5. Response.Redirect("copyofdefault.aspx")
  6. End Sub
  7. End Class

Replace ImageButton1_Click with the name of you ImageButton_Click. That code needs to be in the code behind on the same page as your image button. Hope that makes sense and fixes your problem!
Last edited by majestic0110 : May 21st, 2008 at 5:31 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

  #13  
May 21st, 2008
Originally Posted by majestic0110 View Post
Did you put it in the event handler of the image button in the code behind file? I have tested it myself and got it working this end. It should look something like this:

  1. Partial Class _Default
  2. Inherits System.Web.UI.Page
  3.  
  4. Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
  5. Response.Redirect("copyofdefault.aspx")
  6. End Sub
  7. End Class

Replace ImageButton1_Click with the name of you ImageButton_Click. That code needs to be in the code behind on the same page as your image button. Hope that makes sense and fixes your problem!



I did that but its the same. It is not really an imagebutton but an image. When I tried clicking on the image in Visual Web Developer it should take me to a Button_Click event function, but it took me to the .vb page only. If I add a regular button, it would work.
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

  #14  
May 21st, 2008
Originally Posted by majestic0110 View Post
Did you try what I suggested in post 8 - it should work !


I am using this:

<asp:img

Not this.

<asp:ImageButton

What is the difference between the two?
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 offline Offline
Veteran Poster

Re: Open form in the same window

  #15  
May 22nd, 2008
Sorry I thought you were using an imagebutton. Try using an ImageButton instead, as I suggested above. it will work I have tested it. Hope this fixes it.
1- An image button is a control that displays an image and responds to mouse clicks on the image.
2- An image control is just used to display an image.

Hope that helps you, please mark thread as solved when you get it working!
Last edited by majestic0110 : May 22nd, 2008 at 6:35 am.
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 1:16 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC