Reputation: 19
i have a hyperlink with imageurl
i want that when i willl press the picture ,
i will write something on text box
i will explain ...
that's the code ...
<asp:HyperLink ID="HyperLink1" runat="server"
ImageUrl="~/Pictures/rsz_ultravnc.jpg"
NavigateUrl="\\192.168.89.5\Inst\vnc\UltraVNC_1.0.4_Setup.exe">Vnc</asp:HyperLink>
i want that when i will press that button i will wite to text box something
on the software that i'm making there is alot of links, i want that when the user will press a picture the text box will write you pressed on this link and on that link ,
foe example if the name of this link is vnc
on the textbox automatacly will write "you pressed vnc"
and so and so ...
hope you understood me ...
thank you .....
Upvotes: 0
Views: 445
Reputation: 2415
You can use JQuery to accomplish this.
$(function(){
$('a').click(function(){
$('#TextBoxId').val('You pressed' + $(this).text());
});
});
Just replace TextBoxId id with id of your text box, and you are done
Upvotes: 1
Reputation: 9027
There's two options.
1. Create onclick event for hyperlink and use update panel to update textbox
2. Use plain javascript
for case 1:
textbox1.text=link.text;
updatepanel1.update();
although, I would prefer to do it Javascript way.
Upvotes: 1