以下に示すように、「a href」タグの InnerHTML が .cs ファイルで定義されている画像があります。
HtmlGenericControl _divToolTipContainer = new HtmlGenericControl("div");
_divToolTipContainer.InnerHtml = "<a href=\"javascript:__doPostBack('" + btnItemThumbnail.ClientID.Replace("_", "$") + "','')\">" +
<img src='" + string.Format("ItemPreview.axd/{0}/width-250/height-328/", item.ID.ToString()) + "'></a>;
今、私が望むのは、この「a href」イベントを「削除」して、条件が (false) の場合、それ以外の場合は jQuery を使用してイベントを再度「追加」することです。サンプルコードを以下に示します。
var objectDiv = document.getElementById(oElementId); // get the object id
If (false){ // condition here
remove the event of the a href tag..
jquery code must be added here..
}else{
add the event again of the a href tag..
jQuery code must be added here..
}
これを行う方法?
ありがとう
ジェイソン