473,320 Members | 1,947 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,320 software developers and data experts.

Calling asp.net function from html hyperlink

2
Hi
I have an asp.net webform that shows an html file in an iFrame. In the html file, I need to mark up some of the text as a hyperlink so that when a user clicks it, it calls an asp.net function on the server, passing the text of the hyperlink as a parameter.

e.g. in the html file, I have this
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <p>This is <myTag>some</myTag> text </p>
  3. </html>
  4.  
the question is, what should myTag be, such that the word 'some' appears as a hyperlink, and when the user clicks on it, an asp.net function is called with the word 'some' passed in as a parameter?

It would be easier if I could use an asp.net linkbutton, but remember this is an html file that's being loaded, so I don't have that option...

maybe the answer is some javascript???

thanks in adv...
May 31 '12 #1
2 2314
madankarmukta
308 256MB
You can achieve it with JQuery.

Here is the sample code for -

Expand|Select|Wrap|Line Numbers
  1. (document).ready(
  2. function () {
  3. $("myTag").click(function () { // Put in the required functionality.})
  4. }() 
Let me know if this works.
Jun 6 '12 #2
michc
2
thanks madankarmukta, I'm assuming that where you have 'Put in the required functionality', I would have some kind of JQuery ajax call?
But I need to popluate a container control that is on the original webform, but not in the container that is hosting the html. Do you know how I can address another container on the webform?
Jun 8 '12 #3

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

Similar topics

3
by: Daniel Hansen | last post by:
I'm sure I saw this somewhere but can't remember where and can't find it now... Is there a PHP function or global variable that will return name of the calling function? I want to do this for...
1
by: Andrew Wilkinson | last post by:
Hi, First off I know that in almost all cases this would be a terrible thing to do, but this is an unusual case where this makes sense. Basically I have a procedure where you pass a string...
1
by: Randi | last post by:
Hi all, I there any way of putting an html hyperlink into a .xml file, and still be able to use the xml tags to format the page? Here is the code of the xml file(real simple) and the .css file. ...
6
by: komal | last post by:
hi all basically my problem is i have to write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function...
0
by: Gareth Clayton | last post by:
I have imported a title list from excel to an access database table and would like to know how to change the imported URL which is long and ugly into html hyperlink code with the title name as...
6
by: jchao123 | last post by:
Dear All, I have an MDB file (Access 2000/XP) which contains generic routines I use in various apps (eg, API calls, File access classes etc). I have compiled into an MDE file which I reference...
16
by: Saroj | last post by:
Is there an way for a function to know who called him ?
2
by: sumanthsclsdc | last post by:
Hello friends, I have a problem, I implemented a class which uses tkinter and displays the window as required, the class will create a window with listbox and inserts some items into it, I...
15
by: dspfun | last post by:
Hi, Is it possible to print the function name of the calling function? For example, f1() and f2() both calls f3(), in f3() I would like to print the name of the function calling f3() which...
3
oranoos3000
by: oranoos3000 | last post by:
hi i want to get time of server with ajax,php,javascript i use under scritp and with method onload i get time on server and show on the page so i want in a period time the same function is run...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.