こんにちはみんな私はここでリンクボタンのIDを使用してクリックされたリンクボタンに基づいていくつかのイベントを作成するためにjavascriptを使用しています私のaspページのコード
<asp:LinkButton ID="Tlbr_Item_New" runat="server" CssClass="button_big">Tlbr_Item_New</asp:LinkButton>
<asp:LinkButton ID="Tlbr_Item_Save" runat="server" CssClass="button_big" OnClientClick="return ToolBarClickItem(this);" >Tlbr_Item_Save</asp:LinkButton>
<asp:LinkButton ID="Tlbr_Item_delete" runat="server" CssClass="button_big" OnClientClick="return ToolBarClickItem(this);" >Tlbr_Item_delete</asp:LinkButton>
<asp:LinkButton ID="Tlbr_Item_Undo" runat="server" CssClass="button_big" OnClientClick="return ToolBarClickItem(this);" >Tlbr_Item_Undo</asp:LinkButton>
<asp:LinkButton ID="Tlbr_Item_Clear" runat="server" CssClass="button_big" OnClientClick="return ToolBarClickItem(this);" >Tlbr_Item_Clear</asp:LinkButton>
<asp:LinkButton ID="Tlbr_Item_Search" runat="server" CssClass="button_big" OnClientClick="return ToolBarClickItem(this);" >Tlbr_Item_Search</asp:LinkButton>
<asp:LinkButton ID="Tlbr_Item_Print" runat="server" CssClass="button_big" OnClientClick="return ToolBarClickItem(this);" >Tlbr_Item_Print</asp:LinkButton>
<asp:LinkButton ID="Tlbr_Item_Close" runat="server" CssClass="button_big" OnClientClick="return ToolBarClickItem(this);" >Tlbr_Item_Close</asp:LinkButton>
これが私のjavascript関数です
function ToolBarClickItem(Item) {
window.style = "cursor:hand;";
var bRes = true;
var sMessage = "";
var ItemID = "";
if (typeof Item == 'object')
ItemID = Item.id;
else
ItemID = Item;
switch (ItemID) {
case "Tlbr_Item_New":
if (NewButtonURL != "")
bRes = eval(NewButtonURL);
break;
case "Tlbr_Item_Save":
if (SaveButtonURL != "")
bRes = eval(SaveButtonURL);
if (bRes == true) {
if (IsAnyRequiredEmpty(document.forms[0])) {
window.alert(ErrorEmptyNotAllowed);
bRes = false;
}
else
sMessage = WarnMessageArray[ItemID];
}
break;
case "Tlbr_Item_delete":
if (DeleteButtonURL != "")
bRes = eval(DeleteButtonURL);
sMessage = WarnMessageArray[ItemID];
break;
case "Tlbr_Item_Undo":
if (UndoButtonURL != "")
bRes = eval(UndoButtonURL);
sMessage = WarnMessageArray[ItemID];
break;
case "Tlbr_Item_Clear":
if (ClearButtonURL != "")
bRes = eval(ClearButtonURL);
break;
case "Tlbr_Item_Search":
if (SearchButtonURL != "")
bRes = eval(SearchButtonURL);
break;
case "Tlbr_Item_Print":
if (PrintButtonURL != "")
bRes = eval(PrintButtonURL);
if (bRes == true && bFreeSearch == false)
if (IsAnyPrimaryEmpty(document.forms[0])) {
window.alert('No Record To Print');
bRes = false;
}
else
CustomPrint(PrintURL);
break;
case "Tlbr_Item_Close":
if (confirm('سيتم إغلاق الشاشة؟'))
window.close();
bRes = false;
break;
}
if (sMessage != "" && bRes == true)
bRes = ShowAskMessage(WarnMessageArray[ItemID]);
return bRes;
}
ローカルIISでテストすると、正常に機能します
しかし、somee.comであるサーバーで公開すると、linkbuttonsがctloo_Tlbr_Item_Saveへの変更を制御し、機能しないため、問題と解決策がわかりません。