Hi all,
I'm not sure if this is the correct forum, but here goes.
Is there a way to not post back after a button (actually imagebutton) is
clicked?
I have something like:
<asp:ImageButton ID="something" ImageUrl="pic.gfx" Runat="Server"
OnClick="ViewDetails('"+id+"')" />
now, this works fine for opening a new window to display the details of the
selected record, but it also causes a postback on the page and I really
don't need it since nothing has changed on the parent page...
Any help?
thanks 4 1592
Jaime,
The problem arises due to the fact that you are using a imagebutton. I think
for your requirement you should be using a hyperlink (can take imageurl).
set the NavigateUrl to "#"
and add an attribute from code behind using
lnkOpener.Attributes.Add("onclick", "ViewDetails('"+id+"')");
this should prevent the postback and still execute ViewDetails which i
presume calls appropriate aspx page with correct id.
HTH
Regards,
Hermit Dave http://hdave.blogspot.com
"Jaime" wrote: Hi all,
I'm not sure if this is the correct forum, but here goes.
Is there a way to not post back after a button (actually imagebutton) is clicked?
I have something like: <asp:ImageButton ID="something" ImageUrl="pic.gfx" Runat="Server" OnClick="ViewDetails('"+id+"')" />
now, this works fine for opening a new window to display the details of the selected record, but it also causes a postback on the page and I really don't need it since nothing has changed on the parent page...
Any help?
thanks
Why don't you just use an Image control instead of an ImageButton control?
--
I hope this helps,
Steve C. Orr, MCSD, MVP http://SteveOrr.net
"Jaime" <j@j> wrote in message news:eZ**************@TK2MSFTNGP09.phx.gbl... Hi all,
I'm not sure if this is the correct forum, but here goes.
Is there a way to not post back after a button (actually imagebutton) is clicked?
I have something like: <asp:ImageButton ID="something" ImageUrl="pic.gfx" Runat="Server" OnClick="ViewDetails('"+id+"')" />
now, this works fine for opening a new window to display the details of the selected record, but it also causes a postback on the page and I really don't need it since nothing has changed on the parent page...
Any help?
thanks
Thanks for the tip. That worked great. Now I have a different question, is
there a way to keep track of the "parent" or "caller" page so when I'm done
updating data in the detail view I can PostBack on the parent page and get
the updated data?
Thanks
Jaime
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:73**********************************@microsof t.com... Jaime,
The problem arises due to the fact that you are using a imagebutton. I think for your requirement you should be using a hyperlink (can take imageurl).
set the NavigateUrl to "#" and add an attribute from code behind using
lnkOpener.Attributes.Add("onclick", "ViewDetails('"+id+"')");
this should prevent the postback and still execute ViewDetails which i presume calls appropriate aspx page with correct id.
HTH
Regards,
Hermit Dave http://hdave.blogspot.com
"Jaime" wrote:
Hi all,
I'm not sure if this is the correct forum, but here goes.
Is there a way to not post back after a button (actually imagebutton) is clicked?
I have something like: <asp:ImageButton ID="something" ImageUrl="pic.gfx" Runat="Server" OnClick="ViewDetails('"+id+"')" />
now, this works fine for opening a new window to display the details of the selected record, but it also causes a postback on the page and I really don't need it since nothing has changed on the parent page...
Any help?
thanks
you can use
window.opener.document.location.reload();
or
window.opener.document.location.href = 'abc.aspx';
can be used to either reload opener or redirect opener to another page
HTH
Regards,
Hermit Dave http://hdave.blogspot.com
"Jaime" wrote: Thanks for the tip. That worked great. Now I have a different question, is there a way to keep track of the "parent" or "caller" page so when I'm done updating data in the detail view I can PostBack on the parent page and get the updated data?
Thanks Jaime
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message news:73**********************************@microsof t.com... Jaime,
The problem arises due to the fact that you are using a imagebutton. I think for your requirement you should be using a hyperlink (can take imageurl).
set the NavigateUrl to "#" and add an attribute from code behind using
lnkOpener.Attributes.Add("onclick", "ViewDetails('"+id+"')");
this should prevent the postback and still execute ViewDetails which i presume calls appropriate aspx page with correct id.
HTH
Regards,
Hermit Dave http://hdave.blogspot.com
"Jaime" wrote:
Hi all,
I'm not sure if this is the correct forum, but here goes.
Is there a way to not post back after a button (actually imagebutton) is clicked?
I have something like: <asp:ImageButton ID="something" ImageUrl="pic.gfx" Runat="Server" OnClick="ViewDetails('"+id+"')" />
now, this works fine for opening a new window to display the details of the selected record, but it also causes a postback on the page and I really don't need it since nothing has changed on the parent page...
Any help?
thanks This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gaëtan |
last post by:
I want to post my form by clicking on a RadioButton but
not on clicking on an ImageButton. How to do to execute
only the click procedure of the ImageButton and not the
postback of my page. Because...
|
by: Matt |
last post by:
I always see the term "postback" from ASP book, but I am not sure if I fully
understand the meaning. Here's my understanding so far, please correct me if
any mistakes.
Here's a typical html...
|
by: Matthew Louden |
last post by:
I created simple ASP.NET web application to test how AutoPostBack property
in a web control works.
I set AutoPostBack property to be true of a web control. When I run the
application, here's the...
|
by: RAJ |
last post by:
In our multi-tier application, we have several ASP.NET user controls which
will update the same data source provided by middle tier logic.
In this particular scenario we have one user control...
|
by: walesboy |
last post by:
greetings -
I have a btnSubmit button with a Handles btnSubmit.click which works great
if all the user does is click that button.
But, if the user ALSO changes a text box on the page (which...
|
by: Wizzard |
last post by:
I have a repeater with and imagebutton on a page useing VS2005 ASP.Net 2.0
<asp:Repeater ID="Repeater1" runat="server" >
<ItemTemplate>
<div>
<asp:ImageButton ImageUrl="button.gif"...
|
by: antonyliu2002 |
last post by:
I know that this has been asked and answered thousands of times. As a
matter of fact, I know that I need to say
If Not Page.IsPostBack Then
'Do something
End If
for things that needs to be...
|
by: Nathan Sokalski |
last post by:
I have a DataList in which the ItemTemplate contains two Button controls
that use EventBubbling. When I click either of them I receive the following
error:
Server Error in '/' Application....
|
by: arti |
last post by:
In Asp.net form, I have 3 panels. I want a button on top of each panel to hide or display the panel. I am able to do it. But when there is any postback, the page loads with its design time setting-...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |