473,386 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

div ASP onclick event

Hi guys, I have the followin problem.

I need to execute from the .aspx file a code-behind function on onClick event.

When I run the project, the ASP sentence is beign execute before show the whole HTML or click the tag.

How can I avoid this? I really need to run this code-behind function after clicking the DIV dat.

I would appreciate any kind of help.

Thank you in advance.

Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="_Default" %>
  2. <%@ Import Namespace="System.IO" %>
  3.  
  4. <HTML>
  5.  <HEAD>
  6.  </HEAD>
  7.  <body>
  8.   <form id="Form1" runat="server">
  9.     <input type="hidden" id="perguntarAbrir" value="test"/>
  10.     <div id="ejemploHTML" onclick="<% preguntarAbrir("C:\\var\\ejemplo.pdf"); %>; ">HTML Link</div><br />
  11.     <br />
  12.   </form>
  13.  </body>
  14. </HTML>
Jul 2 '10 #1
1 4907
Frinavale
9,735 Expert Mod 8TB
You can handle the onclick event for a <div> element using JavaScript. You can submit the page to the server for processing using JavaScript.

-Frinny
Jul 12 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Andreas Knollmann | last post by:
Hi, I create an object like this: var cell = document.createElement("td"). It doesn't have to be cell. I want this cell to use the onclick event. What doesn't work in the IE as well as with...
17
by: Mike Gratee | last post by:
Is it possible to use JavaScript to cause the browser to click a link on a page and have the browser act exactly like the user had clicked on the link directly? In other words, I need to...
3
by: Jamie Jackson | last post by:
I'm rewriting all links' onclick events, but I'm having a problem. The onclick event that I'm inserting works correctly in Opera, but not in FF or IE. I'm retroactively adding the statement...
3
by: f1crazed | last post by:
Hello, I am wanting to fire the onClick event of button1 by pressing button2. Does anyone have a clue if this is even posible? If so PLEASE HELP!! Thanks.
17
by: abs | last post by:
My element: <span onclick="alert('test')" id="mySpan">test</span> Let's say that I don't know what is in this span's onclick event. Is it possible to add another action to this element's onclick...
5
by: moondaddy | last post by:
I have a <a> element in a datagrid which wraps some asp.net labels. this element also has an onclick event which does not fire in netscape 6 (and perhaps other browsers for all I know...). Below...
14
by: teddysnips | last post by:
WINDOWS FORMS I've a form that has a textbox that allows the user to enter a string. On the LostFocus event, the textbox formats the string into a preferred format. However, if the user...
5
by: Stuart Shay | last post by:
Hello All I am working on ASP.NET 1.1 Custom Pager that allows a User to Enter a Number in a TextBox and go to the page selected. Since the OnClick Event does not work in ASP.NET 1.1 for a...
3
by: Michael_R_Banks | last post by:
I'm trying to dynamically build a table that allows users to remove rows when they click a corresponding button. For some reason, whenever I add the button to the table, it never fires the onclick...
2
by: DavidGeorge | last post by:
In an earlier thread I recounted a problem I was having, but it took a while to reduce the problem to it's basic components and the issue became somewhat confused in reaching that point. I hope you...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
0
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...
0
marktang
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,...
0
Oralloy
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.