Image Button Postback
-
i am having an image button and i need the click event of the image button to fire but postback should be prevented,is it possible.I tried several methods but didn't worked for me.I even replaced the image button with a image control and used javascript,but still it didn't worked for me. My requirement is that on the image button click i want to make another web control visible but i need to prevent postback once the click event is fired. Can any one help? Thanks in advance
-
i am having an image button and i need the click event of the image button to fire but postback should be prevented,is it possible.I tried several methods but didn't worked for me.I even replaced the image button with a image control and used javascript,but still it didn't worked for me. My requirement is that on the image button click i want to make another web control visible but i need to prevent postback once the click event is fired. Can any one help? Thanks in advance
-
why don't you use image html instead of asp:imagebutton ? on image html you can create onclick or onclientclick eventhandler to fire your method that will show your control. hope it helps
-
i am having an image button and i need the click event of the image button to fire but postback should be prevented,is it possible.I tried several methods but didn't worked for me.I even replaced the image button with a image control and used javascript,but still it didn't worked for me. My requirement is that on the image button click i want to make another web control visible but i need to prevent postback once the click event is fired. Can any one help? Thanks in advance
Anupbala wrote:
i am having an image button and i need the click event of the image button to fire but postback should be prevented,is it possible.
Nope. As it is a server-side control, it would Postback.
Anupbala wrote:
My requirement is that on the image button click i want to make another web control visible but i need to prevent postback once the click event is fired.
You can do it using JavaScript. But do not set the Visible Property of the Web Control to false. If you set it, the page would not render that control. So, you will not able to find the control using JavaScript. Use Style property to set the visibility/block. Then write your code to make it visible/hidden
[Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot
-
Anupbala wrote:
i am having an image button and i need the click event of the image button to fire but postback should be prevented,is it possible.
Nope. As it is a server-side control, it would Postback.
Anupbala wrote:
My requirement is that on the image button click i want to make another web control visible but i need to prevent postback once the click event is fired.
You can do it using JavaScript. But do not set the Visible Property of the Web Control to false. If you set it, the page would not render that control. So, you will not able to find the control using JavaScript. Use Style property to set the visibility/block. Then write your code to make it visible/hidden
[Venkatesh Mookkan] My: Website | Yahoo Group | Blog Spot
-
ASP.NET render menu control as HTML table. So you can find this element and change visibility using JS.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
i am having an image button and i need the click event of the image button to fire but postback should be prevented,is it possible.I tried several methods but didn't worked for me.I even replaced the image button with a image control and used javascript,but still it didn't worked for me. My requirement is that on the image button click i want to make another web control visible but i need to prevent postback once the click event is fired. Can any one help? Thanks in advance
Call this function on event ONClienClick of image button.Menu1 is the ID of menu.
function MakeVisible() { var menu=document.getElementById('Menu1'); menu.style.display='none'; return false; }
html view for image button as below.<asp:ImageButton ID="ImageButton1" runat="server" OnClientClick="return MakeVisible()" />
For making visible,then give,menu.style.display=block;
Arun J
modified on Thursday, January 31, 2008 3:35:39 AM