Here is an extract of HTML from within a standard HTML page:
<form name='login_form' action='http://localhost/BOB.WebPortal/LoginForm.aspx' method='post> <div id='content_logins'> <div id='spacer_ie' style='width:990px; height:7px; border:none; float:left'></div> <div style='width:255px; height:22px; border:none; float:left'></div> <div style='width:172px; border:none; float:left; vertical-align:bottom'> <input type='text' name='uname' id='uname' size='13' /></div> <div style='width:110px; border:none; float:left'> <input type='password' name='pword' id='pword' size='13' /></div> <div style='width:140px; height:22px; border:none; margin-top:-2px; float:left'> <!--input class='btbgfix' type='image' src='images/submit.png' alt='Submit' value='Login'--> <input name='submit' id='loginButton' class='btbgfix' type='image' src='images/submit.png' alt='Submit' value='Login'></div> <div style='width:320px; height:22px border:none; float:left'> <img name='login' src='x.gif' id='alogin' usemap='#m_login' border='0' width='320' height='22' /> <map name='m_login' id='m_login'> <area shape='rect' coords='0,0,681,22' href='https://www.aetmyportfolio.com.au' target='_blank' alt='Go to AET My Portfolio' /> </map> </div> </div> </form>
My problem is that I am trying to retrieve the post value uname and pword using Request.Form from within the Page_Load event of the C# codebehind file in my ASP.Net application. However I find that Request.Form is empty. However if I use Request.Params then I can access the values as they are being passed as query string values in the URL.
Am I doing something wrong in my html?
Assuming that’s a direct copy-paste from your HTML, you’re missing a closing quote on the end of ‘post’.