Являюсь новичком в asp.net программировании
Имеется стандартная форма авторизации прикрученная к MS TMG Server, и форма отправки одноразового пароля через sms.
Ранее я (конечно не правильно) использовал iframe, вставляя страницу с отправкой одноразового пароля в форму TMG, после чего в самой форме пользователь уже заполнял логин, пароль и одноразовый пароль.
С некоторых пор iframe перестал отображаться, вероятно safenet что-то накрутили с безопасностью.
Сам скрипт ввода пароля имеет вид:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
<%@ Page Language="C#" AutoEventWireup="true" Codebehind="Logon.aspx.cs" Inherits="SAMSMS.Logon" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<form id="form1" runat="server" defaultbutton="cmdLogin">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="nowrap" style="width: 286px">
<input id="txtUserName" runat="server" maxlength="32"></asp:TextBox>
</td>
</tr>
<tr>
<td class="nowrap" style="width: 286px">
<asp:Button id="cmdLogin" runat="server" OnClick="CmdLogin_ServerClick" Text="Sent OTP" ValidationGroup="LoginValidators" CssClass="submit" /></td>
</tr>
</table>
</form>
</html>
формf TMG:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- {57A118C6-2DA9-419d-BE9A-F92B0F9A418B} -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; CHARSET=utf-8">
<title>@@L_OWAWindowTitle_Text</title>
<meta content="NOINDEX, NOFOLLOW" name="Robots">
<link rel="shortcut icon" href="/CookieAuth.dll?GetPic?formdir=@@FORMDIR&image=favicon.ico" type="image/x-icon">
<link href="/CookieAuth.dll?GetPic?formdir=@@FORMDIR&image=logon_style.css" type="text/css" rel="stylesheet">
<link href="/CookieAuth.dll?GetPic?formdir=@@FORMDIR&image=owafont.css" type="text/css" rel="stylesheet">
<script src="/CookieAuth.dll?GetPic?formdir=@@FORMDIR&image=flogon.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
var a_fGzpEnbl = 1;
var g_fFcs = 1;
function window_onload()
{
onld();
if (chkCookies())
{
ldCookie('userid', 'passcode');
var expl1 = document.getElementById('expl1');
expl1.style.display = "";
var expl2 = document.getElementById('expl2');
expl2.style.display = "";
var expl3 = document.getElementById('expl3');
expl3.style.display = "";
var lnkHidedSection = document.getElementById('lnkHdSec');
lnkHidedSection.style.display = "none";
var lnkShowSection = document.getElementById('lnkShwSec');
lnkShowSection.style.display = "";
var lnkHidedSection2 = document.getElementById('lnkHdSec2');
lnkHidedSection2.style.display = "none";
var lnkShowSection2 = document.getElementById('lnkShwSec2');
lnkShowSection2.style.display = "";
var lnkHidedSection3 = document.getElementById('lnkHdSec3');
lnkHidedSection3.style.display = "none";
var lnkShowSection3 = document.getElementById('lnkShwSec3');
lnkShowSection3.style.display = "";
var un = document.getElementById('un');
un.style.display = "none";
var chk = document.getElementById('optClk')
chk.style.display = "";
}
}
-->
</script>
</head>
<body class="owaLgnBdy" onload="return window_onload();">
<noscript>
<div id="dvErr">
<table cellpadding="0" cellspacing="0">
<tr>
<td><img alt="" src="/CookieAuth.dll?GetPic?formdir=@@FORMDIR&image=lgnerror.gif"></td>
<td style="width:100%">@@L_OWANoScriptMessage_Text</td>
</tr>
</table>
</div>
</noscript>
<form action="@@URL?Logon" method="post" id="logonForm" autocomplete="off">
<input id="stage" type="hidden" name="stage" value="useridandpasscode" />
<input id="curl" type="hidden" name="curl" value="@@DESTINATION" />
<input id="flags" type="hidden" name="flags" value="0" />
<input id="sessionid" type="hidden" name="sessionid" value="@@SESSIONID" />
<input id="forcedownlevel" type="hidden" name="forcedownlevel" value="0" />
<input id="formdir" type="hidden" name="formdir" value="@@FORMDIR" />
<!-- Main table -->
<table align="center" id="tblMain" cellpadding=0 cellspacing=0>
<tr>
<td colspan=3>
<table cellspacing=0 cellpadding=0 class="tblLgn">
<tr>
<td class="lgnTL"><img src="/CookieAuth.dll?GetPic?formdir=@@FORMDIR&image=lgntopl.gif" alt=""></td>
<td class="lgnTM"></td>
<td class="lgnTR"><img src="/CookieAuth.dll?GetPic?formdir=@@FORMDIR&image=lgntopr.gif" alt=""></td>
</tr>
</table>
</td>
</tr>
<tr>
<td id="mdLft"> </td>
<td id="mdMid">
<!-- Mid table -->
<table id="tblMid" class="mid">
<tbody>
<tr>
<td class="expl" id="expltxt"></td>
</tr>
<tr>
<td class="align">
<!-- Table 1-->
<table cellpadding="0" cellspacing="0">
<tr>
<td class="wrng">@@INSERT_USER_TEXT</td>
</tr>
</table>
<!-- End Table 1-->
</td>
</tr>
<tr>
<td>
<hr /><!-- HR-->
</td>
</tr>
<tr>
<td class="align">
<!-- Table 2-->
<table cellpadding="0" cellspacing="0">
<col>
<col class="w100">
<tr id="trSec">
<td class="nowrap">
@@L_ShowTrustTitle_Text
</td>
<td id="expl1" style="display:none">
( <a href="javascript:clkExp(lnkShwSec)" id="lnkShwSec" >@@L_ShowDetail_Text</a><a href="javascript:clkExp(lnkHdSec)" id="lnkHdSec">@@L_HideDetail_Text</a> )
</td>
</tr>
</table>
<!-- End Table 2-->
</td>
</tr>
<tr>
<td>
<!--Table 3-->
<table cellpadding="0" cellspacing="0">
<col>
<col class="w100">
<tr class="height">
<td><input id="rdoPblc" type="radio" name="trusted" value="0" class="rdo" onclick="clkSec()" checked="checked" /></td>
<td><label for="rdoPblc">@@L_ShowPublicUI_Text</label></td>
</tr>
<tr id="trPubExp" class="expl" style="display:none">
<td></td>
<td>@@L_PublicDescription_Text</td>
</tr>
<tr class="height">
<td><input id="rdoPrvt" type="radio" name="trusted" value="4" class="rdo" onclick="clkSec()" /></td>
<td><label for="rdoPrvt">@@L_ShowTrustedUI_Text</label></td>
</tr>
<tr id="trPrvtExp" class="expl" style="display:none">
<td></td>
<td>@@L_PremiumTrustDescription_Text</td>
</tr>
<tr id="trPrvtWrn" class="wrng" style="display:none">
<td></td>
<td>@@L_TrustWarning_Text</td>
</tr>
</table>
<!-- End Table 3-->
</td>
</tr>
<tr>
<td>
<hr /><!-- HR-->
</td>
</tr>
<tr>
<td>
<!-- Table 4-->
<table cellpadding="0" cellspacing="0">
<col>
<col class="w100">
<tr>
<td valign="top">
<input id="chkBsc" name="chkBsc" type="checkbox" class="rdo" onclick="clkBsc()" />
</td>
<td>
<label for="chkBsc">@@L_OWAUserExperienceLabel_Text</label>
</td>
</tr>
<tr id="trBscExp" class="disBsc" style="display:none">
<td></td>
<td>@@L_OWAUserExperienceDescription_Text</td>
</tr>
</table>
<!-- End Table 4-->
</td>
</tr>
<tr>
<td>
<hr /><!-- HR-->
</td>
</tr>
<tr>
<td class="align">
<!-- Table 5-->
<table cellpadding="0" cellspacing="0">
<col>
<col class="w100">
<tr class="height">
<td class="nowrap">
@@L_ISA_Credentials_Text
</td>
<td id="expl2" style="display:none">
( <a href="javascript:clkExp2(lnkShwSec2);" id="lnkShwSec2">@@L_ShowDetail_Text</a><a href="javascript:clkExp2(lnkHdSec2);" id="lnkHdSec2">@@L_HideDetail_Text</a> )
</td>
</tr>
<tr id="trPrvtExp2" class="expl" style="display:none">
<td colspan="2">@@L_PasscodeHelp_Text</td>
</tr>
</table>
<!-- End Table 5-->
</td>
</tr>
<tr>
<td>
<!-- Table 6-->
<table cellspacing="0" cellpadding="0">
<colgroup>
<col class="nowrap">
<col class="w100">
<col>
<tbody>
<tr>
<td class="nowrap"><label for="userid">@@L_UserID_Text</label></td>
<td class="txtpad">
<input class="txt" id="userid" name="userid" maxlength="32" value="@@USER" />
</td>
</tr>
<tr>
<td class="nowrap"><label for="password">@@L_Password_Text</label></td>
<td class="txtpad">
<input class="txt" id="password" onfocus="g_fFcs=0" type="password" name="password" />
</td>
</tr>
<tr>
<td class="nowrap"><label for="passcode">@@L_Passcode_Text</label></td>
<td class="txtpad">
<input class="txt" id="passcode" onfocus="g_fFcs=0" type="password" name="passcode" />
</td>
</tr>
<tr>
<td class="nowrap"> </td>
<td class="txtpad" colspan="2">
<input class="btn" onmousedown="this.className='btnOnMseDwn'" id="SubmitCreds" onmouseover="this.className='btnOnMseOvr'" onclick="clkLgn()" onmouseout="this.className='btn'" type="submit" value="@@L_LoginButton_Text" name="SubmitCreds" />
</td>
</tr>
</tbody>
</table>
<!-- End Table 6-->
</td>
</tr>
<tr>
<td>
<hr /><!-- HR-->
</td>
</tr>
<tr>
<td>
<iframe src="https://domain.com/sammessaging/Logon.aspx"></iframe>
</td>
</tr>
<tr>
<td>
<hr /><!-- HR-->
</td>
</tr>
</tbody>
</table>
<!-- End Mid Table-->
<!-- Mid2 Table-->
<table id="tblMid2" class="mid" style="display:none">
<tr><td><hr /></td></tr>
<tr>
<td>
@@L_CookiesDisabledWrn_Text
</td>
</tr>
<tr><td><hr></td></tr>
<tr>
<td class="txtpad">
<input type="button" class="btn" style="float: right" value="@@L_RetryButton_Text" onclick="clkRtry()"
onmouseover="this.className='btnOnMseOvr'" onmouseout="this.className='btn'" onmousedown="this.className='btnOnMseDwn'">
</td>
</tr>
</table>
<!-- End Mid Table-->
<table class="mid tblConn">
<tr>
<td rowspan=3 style="vertical-align:top" class="tdConnImg"><img src="/CookieAuth.dll?GetPic?formdir=@@FORMDIR&image=lgnexlogo.gif" alt=""></td>
<td class="tdConn" style="padding-top:6px;">@@L_OWAConnectedToExchange</td>
</tr>
<tr>
<td class="tdConn" style="padding-top:0px;">@@L_SecuredByISA</td>
</tr>
<tr>
<td class="tdCopy">@@L_Copyright</td>
</tr>
</table>
</td>
<td id="mdRt"> </td>
</tr>
<tr>
<td colspan=3>
<table cellspacing=0 cellpadding=0 class="tblLgn">
<tr>
<td class="lgnBL"><img src="/CookieAuth.dll?GetPic?formdir=@@FORMDIR&image=lgnbotl.gif" alt=""></td>
<td class="lgnBM"></td>
<td class="lgnBR"><img src="/CookieAuth.dll?GetPic?formdir=@@FORMDIR&image=lgnbotr.gif" alt=""></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<!-- End Main Table-->
</form>
</body>
</html>
userid в форме TMG идентичен txtUserName в форме safenet
хочу либо победить iframe, либо вставить кнопку по нажатию которой уже запрос на отправку уйдет заполненный данными из userid без перезагрузки страницы.