Your code works fine for me in conjunction with the following html and cgi script:
index.html:
<!DOCTYPE html>
<html>
<head><title>Python CGI</title></head>
<body>
<form action="cgi-bin/mycgi.pl" method="post">
<div>
<label for="name">User Name:</label>
<input id="name" name="ctl00$cntPlaceHolder$UsernameTextBox" typ
+e="text">
</div>
<div>
<label for="password">Last Name:</label>
<input id="password" name="ctl00$cntPlaceHolder$PasswordTextBox"
+ type="password">
</div>
<div>
<input type="submit" value="submit">
</div>
</form>
</body>
</html>
mycgi.pl:
#!/usr/bin/env perl
use CGI;
use CGI::Carp qw{ fatalsToBrowser };
my $cgi = CGI->new;
print $cgi->header,
$cgi->start_html('Test Page'),
$cgi->h4('Params:'),
$cgi->div('Name: ' . $cgi->param('ctl00$cntPlaceHolder$UsernameT
+extBox')),
$cgi->div('Password: ' . $cgi->param('ctl00$cntPlaceHolder$Passw
+ordTextBox')),
$cgi->end_html;
HTML Code after clicking view source
But what does your program output from the following line:
print $page;