I have a simple webform that works during debugging, but once I publish to the website it is not working as expected.
The Form gets web address and appends the user name (SmithJ) to the end of the address.
This works as it is expected to during the debug process.
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1" %><!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></head><body> <div> <form id="form1" method="get" action="https://commerce.wsj.com/auth/group/login?"> <input type="hidden" name="groupSignOnId" value="TestLaw"/> <input type="hidden" name="groupSignOnPassword" value="fstessstM34iAw"/> <input type="hidden" name="groupUserKey" id="groupUserKey" runat="server"/> <input type="submit" value="Register your WSJ Subscription"/> </form></div>1. Enter First & Last Name <br />2. Enter your Firm E-mail address & confirm it<br />3. Create a unique password for yourself <br />4. Select your Job Title<br />5. Check the Subscriber Agreement<br /> 6. Press Create Account<br /> <br /> This is an exampe:<br /><asp:Image ID="img1" runat="server" ImageUrl=".\images\img1.png" Height="576px" Width="333px" /> <br /> <br />7. Once you press Create Account you will be brought to another page that shows you that you successfully registered for the firm subscription to WSJ<br />8. Press OK and you will be brought to WSJ Online site <a href="http://online.wsj.com/home-page">http://online.wsj.com/home-page</a><br /> <br /><asp:Image ID="Image1" runat="server" ImageUrl=".\images\img2.png" Height="164px" Width="278px" /><br /> <div> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </div></body></html>
Imports System.WebPublic Class WebForm1 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load groupUserKey.Value = Environment.UserName() Label1.Text = Environment.UserName() End SubEnd Class
For testing purposes I added ASP:LABEL to display what the value is.
When it run it from the IIS server it just displays the APPLICATION POOL assigned to the app.
If there is a better way for me to accomplish getting the user name to the id="groupUserKey" value then I am completely open to the change.
There must be a setting on the IIS server that is not pulling the
Environment.UserName() where in Debug it is.
any ideas?