PDA

View Full Version : ASP Login form


jfreak53
06-24-2010, 05:32 PM
Ok so I have this client who I am re-doing an old page we did together years ago. But he also has this web system that was created by the company that made him the schools grading system in .NET. Well they made this web system for parents and students to log in to view these things on the web right. So all that's fine, it's hosted on their servers at the school, so no problem there. The problem is that he wants the web page to have a login form that logs into this system over the web. Now I would ask the developers about how to integrate their system since they made it, but THEY DON'T EVEN KNOW! ha ha So I have to figure this out myself.

The page for login on their site is:


<!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><title>
..:: Web MSSchool ::..
</title></head>
<body>
<form name="aspnetForm" method="post" action="login.aspx" id="aspnetForm">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTc0ODMxODg5MA9kFgJmD2QWAgIDD2QWAgIDD2QWAmYPZBYCAgEPDxYCHgRUZXh0BQpJbmdyZXNvLi4uZGQYAQUeX19Db 250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgMFI2N0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkb3B0QWx1bW5vBSNjdGwwMCRDb 250ZW50UGxhY2VIb2xkZXIxJG9wdEFsdW1ubwUkY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRvcHRGYW1pbGlhx/2Ja9GpJiGPRkzNZMs4/Up7SoE=" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
if (!theForm) {
theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>

</script>


<script src="/WebResource.axd?d=OuJd8Cf7Qd3BKPX0PMpAcQ2&amp;t=633711813216114240" type="text/javascript"></script>


<script src="/ScriptResource.axd?d=E2243a3WaVPJ_WKk2_IJneznpvPnL9zLPy8l7Q7_9VR_e8DeFwDMpJikDDEJOI5kH7AHCUlSu1pPbaI ol6EUXNwOPz620Fl4BJbnw6Hvs4M1&amp;t=633713426622593648" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=E2243a3WaVPJ_WKk2_IJneznpvPnL9zLPy8l7Q7_9VR_e8DeFwDMpJikDDEJOI5kH7AHCUlSu1pPbaI ol6EUXCryZyRB8w6RTfru-iTS_r-I7SciA439LAgxpgYciB7E0&amp;t=633713426622593648" type="text/javascript"></script>
<div title="..:: Web MSSchool ::..">
<br />
<br />

<br />
<br />
&nbsp;<br />
<br />
<br />
<br />
<br />
<br />
<br />

<br />
<br />
<br />
<table style="z-index: 102; left: 0px; position: absolute; top: 0px; height: 272px; width: 764px;">
<tr>
<td colspan="3" style="overflow: hidden; height: 175px">
&nbsp;&nbsp;&nbsp; &nbsp;
<img src="Images/HeadSM.jpg" /></td>

</tr>
<tr>
<td colspan="2" rowspan="2" style="width: 59px">
&nbsp;<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ctl00$ScriptManager1', document.getElementById('aspnetForm'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tctl00$UpdatePanel1','tctl00$ContentPlaceHolder1$UpdatePanel1'], [], [], 90);
//]]>
</script>

<div id="ctl00_UpdatePanel1">

<span id="ctl00_lblEstado" style="display:inline-block;color:#3C55E3;font-family:Tahoma;font-size:Small;width:152px;z-index: 100; left: 8px; position: absolute; top: 216px">Ingreso...</span>
&nbsp;&nbsp;&nbsp;&nbsp;


&nbsp;&nbsp;&nbsp;
<input type="button" name="ctl00$Button1" value="Cerrar Sesion" onclick="javascript:__doPostBack('ctl00$Button1','')" id="ctl00_Button1" tabindex="20" style="width:110px;z-index: 103;
left: 8px; position: absolute; top: 248px" />

</div>
</td>
</tr>
<tr>
<td style="width: 464px; height: 234px">

<div id="ctl00_ContentPlaceHolder1_UpdatePanel1">


<span id="ctl00_ContentPlaceHolder1_Label1" style="display:inline-block;color:#3C55E3;font-family:Tahoma;font-size:Medium;width:336px;Z-INDEX: 100; LEFT: 160px; POSITION: absolute; TOP: 208px">Ingreso al Sistema...</span>
<HR style="Z-INDEX: 100; LEFT: 160px; WIDTH: 592px; POSITION: absolute; TOP: 232px" />
<span style="display:inline-block;font-family:Tahoma;font-size:8pt;width:72px;Z-INDEX: 101; LEFT: 336px; POSITION: absolute; TOP: 280px"><input id="ctl00_ContentPlaceHolder1_optAlumno" type="radio" name="ctl00$ContentPlaceHolder1$TipoUsuario" value="optAlumno" /><label for="ctl00_ContentPlaceHolder1_optAlumno">Alumno(a)</label></span> <span style="display:inline-block;font-family:Tahoma;font-size:8pt;width:73px;Z-INDEX: 102; LEFT: 256px; POSITION: absolute; TOP: 280px"><input id="ctl00_ContentPlaceHolder1_optFamilia" type="radio" name="ctl00$ContentPlaceHolder1$TipoUsuario" value="optFamilia" checked="checked" /><label for="ctl00_ContentPlaceHolder1_optFamilia">Familia</label></span> <span id="ctl00_ContentPlaceHolder1_Label2" style="display:inline-block;font-family:Tahoma;font-size:Smaller;height:16px;width:64px;Z-INDEX: 103; LEFT: 160px; POSITION: absolute; TOP: 320px">Usuario:</span> <span id="ctl00_ContentPlaceHolder1_Label3" style="display:inline-block;font-family:Tahoma;font-size:Smaller;width:80px;Z-INDEX: 104; LEFT: 160px; POSITION: absolute; TOP: 352px">Contraseña:</span> <input name="ctl00$ContentPlaceHolder1$txtUsuario" type="text" id="ctl00_ContentPlaceHolder1_txtUsuario" style="width:144px;Z-INDEX: 105; LEFT: 256px; POSITION: absolute; TOP: 312px" /> <input name="ctl00$ContentPlaceHolder1$txtPassword" type="password" id="ctl00_ContentPlaceHolder1_txtPassword" style="width:144px;Z-INDEX: 106; LEFT: 256px; POSITION: absolute; TOP: 344px" /> <span id="ctl00_ContentPlaceHolder1_lblMensajes" style="display:inline-block;color:Red;font-family:Tahoma;font-size:8pt;font-weight:bold;width:395px;Z-INDEX: 107; LEFT: 256px; POSITION: absolute; TOP: 416px"></span> <input type="submit" name="ctl00$ContentPlaceHolder1$btnIngresar" value="Ingresar" id="ctl00_ContentPlaceHolder1_btnIngresar" style="width:100px;Z-INDEX: 109; LEFT: 296px; POSITION: absolute; TOP: 376px" />

</div>

</td>
</tr>
</table>
</div>

<div>

<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBwKK68LkDgLl97ftDQKb2oC+AgLc/eurBwKnqqeUBAL90KKTCAKK4N3OCTv2q6CierExzNGqkKScCYlV1d3E" />
</div>

<script type="text/javascript">
//<![CDATA[
Sys.Application.initialize();
//]]>
</script>

</form>
</body>
</html>


Ok for one it's a mess I know, it's not mine. But I tried just doing this and it won't login:

<form name="aspnetForm" method="post" action="http://ip/login.aspx" id="aspnetForm">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTc0ODMxODg5MA9kFgJmD2QWAgIDD2QWAgIDD2QWAmYPZBYCAgEPDxYCHgRUZXh0BQpJbmdyZXNvLi4uZGQYAQUeX19Db 250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgMFI2N0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkb3B0QWx1bW5vBSNjdGwwMCRDb 250ZW50UGxhY2VIb2xkZXIxJG9wdEFsdW1ubwUkY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRvcHRGYW1pbGlhx/2Ja9GpJiGPRkzNZMs4/Up7SoE=" />

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
if (!theForm) {
theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>

</script>


<script src="http://ip/WebResource.axd?d=OuJd8Cf7Qd3BKPX0PMpAcQ2&amp;t=633711813216114240" type="text/javascript"></script>


<script src="http://ip/ScriptResource.axd?d=E2243a3WaVPJ_WKk2_IJneznpvPnL9zLPy8l7Q7_9VR_e8DeFwDMpJikDDEJOI5kH7AHCUlSu1pPbaI ol6EUXNwOPz620Fl4BJbnw6Hvs4M1&amp;t=633713426622593648" type="text/javascript"></script>
<script src="http://ip/ScriptResource.axd?d=E2243a3WaVPJ_WKk2_IJneznpvPnL9zLPy8l7Q7_9VR_e8DeFwDMpJikDDEJOI5kH7AHCUlSu1pPbaI ol6EUXCryZyRB8w6RTfru-iTS_r-I7SciA439LAgxpgYciB7E0&amp;t=633713426622593648" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ctl00$ScriptManager1', document.getElementById('aspnetForm'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tctl00$UpdatePanel1','tctl00$ContentPlaceHolder1$UpdatePanel1'], [], [], 90);
//]]>
</script>

Ingreso al Sistema...<br>
<br><input id="ctl00_ContentPlaceHolder1_optAlumno" type="radio" name="ctl00$ContentPlaceHolder1$TipoUsuario" value="optAlumno" /><label for="ctl00_ContentPlaceHolder1_optAlumno">Alumno(a)</label>
<br><input id="ctl00_ContentPlaceHolder1_optFamilia" type="radio" name="ctl00$ContentPlaceHolder1$TipoUsuario" value="optFamilia" checked="checked" /><label for="ctl00_ContentPlaceHolder1_optFamilia">Familia</label>
<br>Usuario: <input name="ctl00$ContentPlaceHolder1$txtUsuario" type="text" id="ctl00_ContentPlaceHolder1_txtUsuario" />
<br>Contraseña: <input name="ctl00$ContentPlaceHolder1$txtPassword" type="password" id="ctl00_ContentPlaceHolder1_txtPassword" />
<br><input type="submit" name="ctl00$ContentPlaceHolder1$btnIngresar" value="Ingresar" id="ctl00_ContentPlaceHolder1_btnIngresar" />

<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBwKK68LkDgLl97ftDQKb2oC+AgLc/eurBwKnqqeUBAL90KKTCAKK4N3OCTv2q6CierExzNGqkKScCYlV1d3E" />

<script type="text/javascript">
//<![CDATA[
Sys.Application.initialize();
//]]>
</script>

</form>

I also tried it without the JS:

<form name="aspnetForm" method="post" action="http://ip/login.aspx" id="aspnetForm">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTc0ODMxODg5MA9kFgJmD2QWAgIDD2QWAgIDD2QWAmYPZBYCAgEPDxYCHgRUZXh0BQpJbmdyZXNvLi4uZGQYAQUeX19Db 250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgMFI2N0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkb3B0QWx1bW5vBSNjdGwwMCRDb 250ZW50UGxhY2VIb2xkZXIxJG9wdEFsdW1ubwUkY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRvcHRGYW1pbGlhx/2Ja9GpJiGPRkzNZMs4/Up7SoE=" />
Alumno(a) <input type="radio" id="ctl00_ContentPlaceHolder1_optAlumno" name="ctl00$ContentPlaceHolder1$TipoUsuario" value="optAlumno" />
Familia <input type="radio" id="ctl00_ContentPlaceHolder1_optFamilia" name="ctl00$ContentPlaceHolder1$TipoUsuario" value="optFamilia" checked="checked" /> <br />
Usuario: <input type="text" name="ctl00$ContentPlaceHolder1$txtUsuario" id="ctl00_ContentPlaceHolder1_txtUsuario" /> <br />
Contrase&ntilde;a: <input type="password" name="ctl00$ContentPlaceHolder1$txtPassword" id="ctl00_ContentPlaceHolder1_txtPassword" /> <br />
<input type="submit" name="ctl00$ContentPlaceHolder1$btnIngresar" value="Ingresar" id="ctl00_ContentPlaceHolder1_btnIngresar" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBwKK68LkDgLl97ftDQKb2oC+AgLc/eurBwKnqqeUBAL90KKTCAKK4N3OCTv2q6CierExzNGqkKScCYlV1d3E" />
</form>

And all it does is tell me the username is wrong. Now, is this correct, should this work this way? If it should work out of the box like this could it be the username I am logging in with? The username have a "á" in it and when I get the login bad screen after trying it comes up with a black question mark in place of that. So that means that the character isn't being passed correctly, right? Or no?

Thanks for any help guys, I don't know ASP for crap at all, I'm a PHP man.

Old Pedant
06-24-2010, 10:27 PM
I'm lost.

Do you mean you have *both* ASP.NET pages and ASP pages and you want the ASP.NET login to automatically also log them in to the ASP pages???

And are the two sets of pages on the same server or on different servers?

In any case, I don't know *WHAT* it is you changed between the two pages.

jfreak53
06-24-2010, 11:56 PM
Ha ha sorry. No they are ASPX pages and when I said .NET I meant they made a software windows program in .NET sorry.

I just want to make a form from another domain, since this is on the servers IP, I want to make a form on the web page to log into this web system, the first one. But the other two are my faint attempts at getting this new form of mine to login to their login.aspx file.

It doesn't work and I can't figure out why. The bottom two scripts are my attempts at making it work, and the first one is their working login script on the IP of the server.

Was this explenatory?

Old Pedant
06-25-2010, 08:46 PM
May not be able to do it.

ASP.NET *can* insist that a <form> be submitted only from a page that it created. In fact, that's the default that is used if you use the standard Visual Studio tools. You actually have to work to create a <form> that can (for example) be submitted via an ordinary ".html" page.

Oh, I'm sure you could find ways to fake it, but they wouldn't be easy.

The best way might be to simply put the other page's <form> into an <iframe> on your main page. And then have have the target of the <form> inside the <iframe> be "_top".

jfreak53
06-25-2010, 09:04 PM
Hmm, so the ASPX extension are ASP.NET files? I was actually thinking of doing the iframe, but it would mean that the makers of it would have to create a new form since this one is huge, a full page! Would it still work if *they* created a new form, a small one to go inside an IFRAME? And left it on the server with the other form?