Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
7
Answers
How to write code behind for <a> tag
Joma Rajab
8y
277
1
Reply
I need to use a tag with click event and the href link I need to write it in code behind
when the link is clicked it will be opened on iframe by writing iframe id in the target of a tag
I tried the code below
please help
Thank you
<a id=
"urlbb"
runat=
"server"
>web1
<asp:PlaceHolder ID=
"url"
runat=
"server"
Visible=
"false"
>
<iframe name=
"aa"
width=
"100%"
height=
"800px"
style=
"margin-top:50px"
></iframe></asp:PlaceHolder>
<asp:PlaceHolder ID=
"mainbody"
runat=
"server"
Visible=
"true"
>
.
.
.
.
</asp:PlaceHolder>
Code behind
protected
void
urlbb_ServerClick(
object
sender, EventArgs e)
{
mainbody.Visible =
false
;
url.Visible =
true
;
urlbb.Target =
"aa"
;
urlbb.HRef =
"http://www.bradford.ac.uk/it-services/students/email/"
;
}
Post
Reset
Cancel
Answers (
7
)
Next Recommended Forum
how to insert and update multiple dynamic checkbox in mvc
web from using ajax