62,046
社区成员
发帖
与我相关
我的任务
分享
<epoint:HyperLinkColumn HeaderText="修改" Name="Edit" NavigateText="<div class='small-icon small-icon-edit'></div>"
NavigateUrl="javascript:ShowEditPage('{RowGuid}');" >
<ItemStyle HorizontalAlign="Center" Width="50px" />
</epoint:HyperLinkColumn>
function ShowEditPage(rowGuid) {
top.OpenDialogBox(epoint.url.getAbsoluteUrl("Elective_Edit.aspx?RowGuid=" + rowGuid), '', '修改记录', refreshGrid);
}
public bool Yanzheng(string RowGuid)
{
string sqls = "select Status from Elective where RowGuid='" + RowGuid + "'";
DataView dv1 = Epoint.MisBizLogic2.DB.ExecuteDataView(sqls);
int sr = Convert.ToInt32(dv1[0][0]);
if (sr == 2 || sr == 3)
{
return false;
}
return true;
}
function Click()
{
document.getElementById("BtnShow").click();
}
然后在页面放入这个Button,在后台写它的事件,调用这个js方法时,在想调用的地方写
ScriptManager.RegisterStartupScript(this.Page, typeof(Page), new Random().Next().ToString() + "1111", "<script language='javascript' defer='defer'>Click();</script>", false);
function ShowEditPage(rowGuid) {
var ss='<%=Yanzheng("'+rowGuid+'") %>';
if (!ss) {
this.WriteAjaxMessage("epoint.dialog.success('只有草稿状态的申请才能修改!');");
return;
}
top.OpenDialogBox(epoint.url.getAbsoluteUrl("Elective_Edit.aspx?RowGuid=" + rowGuid), '', '修改记录', refreshGrid);
}
function ShowEditPage(rowGuid) {
var ss=<%=Yanzheng("'+rowGuid+'") %>
if (!ss) {
this.WriteAjaxMessage("epoint.dialog.success('只有草稿状态的申请才能修改!');");
return;
}
top.OpenDialogBox(epoint.url.getAbsoluteUrl("Elective_Edit.aspx?RowGuid=" + rowGuid), '', '修改记录', refreshGrid);
}
这样写不对呀 还是直接打开下面那个修改页面了