Basically, I have a login control on Default.aspx page, where I am authenticating a user and on valid username and password, I am navigating them to another page Upload.aspx.
On page Upload.aspx, I want to store username value in a global variable and then pass this global variable around in number of SQL procedure.
To get the username value on page Upload.aspx I have this code under page_load event
public partial class Upload : System.Web.UI.Page
{
public static string uname;
public static string un;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
un = HttpContext.Current.User.Identity.Name;
uname = un;
clsClass find_user_type = new clsClass();
user_Type = find_user_type.Find_UserType_Of(uname).Trim();
}
else
{
uname = un; //the first If condition will be true atleast 1st,
//so that one `un` is set i can copy it into `uname`
//when its postback
}
}
}
Find_UserType_Of(uname) is a method in clsClass that takes a string parameter (uname).
Now, this code runs just fine when I am running it on local machine when server is my localhost. But when I upload this to a webserver, it starts acting funny and tells me that a procedure in
Find_UserType_Of(uname) method requires a parameter which was not passed!
Any idea, what is going on?
Thanks