How do you set href attribute of anchor tag that is within a repeater in code behind?

后端 未结 4 1525
庸人自扰
庸人自扰 2021-01-25 06:23

normally on would use the following :-

aspx page:-

Link1 

code behind:-

4条回答
  •  半阙折子戏
    2021-01-25 06:57

    You can do it in the event ItemDatabound of your repeater:

    ((HtmlAnchor)e.Item.FindControl("a1")).HRef = "www.mySite.com/mypage.aspx";
    

提交回复
热议问题