Показать сообщение отдельно
Старый 29.05.2012, 15:22   #7  
Taker1796 is offline
Taker1796
Участник
Аватар для Taker1796
 
112 / 11 (1) +
Регистрация: 22.04.2012
Цитата:
Сообщение от a33ik Посмотреть сообщение
У меня заработало. Первое писал на колене по памяти. Включайте дебаггер и тестируйте.
Может я что то не так делаю? Я создал aspx страницу, добавил на неё кнопку, по нажатию кнопки вызываю функцию, которая должна писать значение в поле родительского окна crm.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function test(selectedindex) {
var myindex = selectedindex.selectedIndex;
var SelValue = selectedindex.options[myindex].value;
window.top.opener.Xrm.Page.getAttribute("name").setValue("sghfh");
}
</script>
</head>
<body bgcolor="White">
<form id="form1" runat="server">
<asp:Label ID="Label1" runat="server" Text="Label">Выберите категорию лида.</asp:Label>
<br>
<br>
<div>
<aspropDownList ID="DropDownList1" runat="server" Width="70">
<asp:ListItem Selected="none"> ... </asp:ListItem>
<asp:ListItem Value="Category A"> A </asp:ListItem>
<asp:ListItem Value="Category B"> B </asp:ListItem>
<asp:ListItem Value="Category C"> C </asp:ListItem>
</aspropDownList>
</div>
<br>
<br>
<asp:Button ID="Button3" runat="server" Text="Button" />
<asp:button ID="Button1" runat="server" text="Ok" Width="100" OnClientClick='test(this.form.DropDownList1);' />
<asp:button ID="Button2" runat="server" text="Отмена" Width="100" OnClientClick='alert("Отмена");' />
</form>
</body>

</html>

На форме crm добавил кнопку, по её нажатии загружаю эту aspx страницу