javascript代码:
Code
function SendDiv(id)
{
var getid = document.getElementById(id);
getid.style.left= window.event.x - 150;
getid.style.top= window.event.y;
getid.style.display='block';
// document.getElementById("case_id").value = document.getElementById("caseid").value;
}
页面操作代码:
Code
<a id="btnAccusation" href="javascript:void(null)" onclick="SendDiv('divDrag')"></a>
<% if (this.UserInfo.UserType != "02")
{ %>
<asp:LinkButton ID="lkbAccusation" runat="server" CommandName="Accusation" CommandArgument='<%#Eval("case_id")%>'
Text="分派"></asp:LinkButton>
<%} %>
服务器段代码:
Code
protected void gvMan_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Accusation")
{
this.case_id.Value = e.CommandArgument.ToString();
ScriptManager.RegisterStartupScript(this, this.GetType(), "loginipasbc", "document.getElementById('btnAccusation').click();", true);
}
}
页面代码(弹出DIV):
Code
<div id="divDrag" cellpadding="0" cellspacing="0" oncontextmenu="return false" style="position: absolute;
background: #9097A9; display: none; z-index: 2; 300; height: 200; border: solid #9097A9 1px; padding-top:10px;
cursor: move;">
<table style="cursor: hand; background-color: #CCCCCC;">
<tr>
<td>
<asp:TreeView ID="tvwSelect" runat="server" ExpandDepth="0" OnSelectedNodeChanged="tvw_SelectedNodeChanged"
SelectedNodeStyle-Font-Bold="true" SelectedNodeStyle-Font-Size="13px" ShowLines="true">
</asp:TreeView>
</td>
</tr>
<tr>
<td>
<input onclick="GoReset('divDrag')" style="float: left; clear: left; display: block;"
type="button" class="btn2chars" value='取消' /></td></tr>
</div>