In my Asp.net application, I have come across a situation where I cannot prevent a postback using the HtmlInputImage control. If I use the HtmlInputButton , the post back is not automatic, however with the HtmlInputImage, it appears to be.
Add this to your aspx test app and set a breakpoint in your Page_Load.
<input type="button" id="TheButton" value="GO"/>
<input type="image" id="TheImage"/>
When you click on the "TheButton" - no postback occurs. When you click on "TheImage" - a postback occurs. Can someone help me stop the postback for the HtmlInputImage?
Thanks,
Alex 2 2645
Hi Alex
U r right the image click is posting the page to the server. It seems some browser setting is causing the page to post on image click.
I did a workaround by putting onclick="return false;" in the input image control and it no longer submits the page to the server.
<input type="image" id="TheImage" onclick="return false;" />
HTH
"Alex" <al**@nospam.ne t> wrote in message news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
In my Asp.net application, I have come across a situation where I cannot prevent a postback using the HtmlInputImage control. If I use the HtmlInputButton , the post back is not automatic, however with the HtmlInputImage, it appears to be.
Add this to your aspx test app and set a breakpoint in your Page_Load.
<input type="button" id="TheButton" value="GO"/>
<input type="image" id="TheImage"/>
When you click on the "TheButton" - no postback occurs. When you click on "TheImage" - a postback occurs. Can someone help me stop the postback for the HtmlInputImage?
Thanks,
Alex
Thanks for the help. Adding return false; to my onclick even solved this issue.
--
Alex
"Vaibhav" <co************ @yahoo.com> wrote in message news:OA******** ******@TK2MSFTN GP14.phx.gbl...
Hi Alex
U r right the image click is posting the page to the server. It seems some browser setting is causing the page to post on image click.
I did a workaround by putting onclick="return false;" in the input image control and it no longer submits the page to the server.
<input type="image" id="TheImage" onclick="return false;" />
HTH
"Alex" <al**@nospam.ne t> wrote in message news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
In my Asp.net application, I have come across a situation where I cannot prevent a postback using the HtmlInputImage control. If I use the HtmlInputButton , the post back is not automatic, however with the HtmlInputImage, it appears to be.
Add this to your aspx test app and set a breakpoint in your Page_Load.
<input type="button" id="TheButton" value="GO"/>
<input type="image" id="TheImage"/>
When you click on the "TheButton" - no postback occurs. When you click on "TheImage" - a postback occurs. Can someone help me stop the postback for the HtmlInputImage?
Thanks,
Alex This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: CodeRazor |
last post by:
I am building my html page in .net. After i click a button, i want an
outline/border to appear around my button. I have found the
HtmlInputImage.Border property and although it prints out (border="5") in the
html when i view source, it fails to show anything in the browser. What am I
failing to do here?
My code behind:
private void ImageBtn_Click(Object sender, ImageClickEventArgs e)
{
HtmlInputImage image = (HtmlInputImage)sender;
|
by: JP |
last post by:
ow do I get a HtmlInputImage to raise the ServerClick event
I have two inputs one is a submit button the other is a
image. The submit button works the input image does not.
Does anyone know why this would happen?
I would like to mention that I have overridden viewstate
and do not use server side forms.
Below is my code maybe I am missing something
|
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 sequences when I step through the program:
1. Page loaded to the browser
2. Page_Load method is called with non-postback event
3. The user has certain actions on a control
4. Page_Load method is called with postback event
|
by: Earl Teigrob |
last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at
http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx
but it was far more complex then I needed. (I got lost trying to figure it all out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution.
...
|
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 displaying the contents
of the data source, whilst another control updates the datasource via a
command buttons implementation of 'Click', an event raised in the 'Handle
Postback Events' stage of the control execution life cycle (via the...
| |
by: CW |
last post by:
I have message entry screen that's causing me a bit of an issue. At the
moment, there are 2 buttons, one is used to send message to another user
(btnSend) and another is used to send messages to all users (btnSendAll).
When user hits enter, I also simulate the effect of clicking button
(btnSend). However, what I found btnSend doesn't fire (unless I click on the
button).
The postback function I call is as follows:
function...
|
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 has it's own
event and autopostback=true) before clicking submit then it fires the text
box event but never fires the btnSubmit event. (I follow it in the trace).
Surely both event handlers should be fired? Any hints on identifying what I
|
by: schleichv |
last post by:
Hello,
I am attempting to get the ServerClick event to fire on a dynamically
generated HtmlInputImage and having no luck at all. I've looked over
many items on the forums but none seem to cover what seems to be
happening to me.
Below is a small test I have put together to demonstrate the issue.
The form has an HtmlInputImage on it that has it's ServerClick event
wired in the code. Another HtmlInputImage is generated in the code and
|
by: John Kotuby |
last post by:
Hi guys,
I am converting a rather complicated database driven Web application from
classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The
original ASP application works quite well, so at times it is tempting just
to port parts of it over mostly as-is. In fact, one MSDN article I read
suggested using straight HTML wherever possible to make the app more
efficient and less resource demanding.
On one page there are 2...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |