渲染时我有一个aspx文件,将图像包装在“a”标记中,如下面的HTML所示:
<td align="right" valign="top" nowrap="true" style="padding-left: 5px;">
<a id="ctl00_PlaceHolderMain_peUserPrimaryPoc_checkNames" tabindex="6" title="Check Names"
onclick="var arg=getUplevel ('ctl00_PlaceHolderMain_peUserPrimaryPoc');var ctx='ctl00_PlaceHolderMain_peUserPrimaryPoc'; EntityEditorSetWaitCursor(ctx);WebForm_DoCallback('ctl00$PlaceHolderMain$peUserPrimaryPoc',arg,EntityEditorHandleCheckNameResult,ctx,EntityEditorHandleCheckNameError,true);return false;"
href="javascript:">
<img title="Check Names" src="/_layouts/images/checknames.gif" alt="Check Names"
style="border-width: 0px;" /></a> <a id="ctl00_PlaceHolderMain_peUserPrimaryPoc_browse"
accesskey="B" tabindex="6" title="Active Directory Picker" onclick="__Dialog__ctl00_PlaceHolderMain_peUserPrimaryPoc(); return false;"
href="javascript:">
<img title="Active Directory Picker" src="/_layouts/images/addressbook.gif" alt="Active Directory Picker"
style="border-width: 0px;" />
</a>
</td>
我需要添加行为,如果用户点击标记ctl00_PlaceHolderMain_peUserPrimaryPoc_browse
中包含的图片,则隐藏父面板PageBodyPanel
,并显示另一个面板'UpdateProgress1'
我的各种尝试包括
<script language="JavaScript" type="text/javascript">
$(document).ready(function () {
//ShowProgress();
var target = null;
target = $('#<%=peUserPrimaryPoc.ClientID %> a '); //get the link surrounding the image
target.click(function () { ShowProgress(); }); //attach a behavior to link click
});
function ShowProgress() {
$('#<%=UpdateProgress1.ClientID %>').show();
$('#<%=PageBodyPanel.ClientID %>').hide();
}
</script>
这与其他各种尝试一起不起作用。有人能指出我正确的方向吗?提前谢谢,
孟加拉