|
I have created a class that returns a class object which have info about the username,pwd,emailid of current user.
Now i want to use this email id in my aspx.cs page to show the current logged in user and its email id....
i m creating an isntance of that class and using that to get the user email...
but i m getting null...
anyone had any idea?
Thanks in Advance,
|
|
|
|
|
your obviously not setting it at the right time, read through your code and make sure the username is declared and avaliable before you set it to show to the current user
|
|
|
|
|
Did you inspect the Request.ServerVariables collection?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I have class named clsUser and function like
public clsUser ValidateUser(string userName,string password)
where return type is the class itself returning username,pwd and emailid of teh user
I want the username and email id of logged in user
what will b the syntax
|
|
|
|
|
salon wrote: class named clsUser
In a class file you may need to use System.Web.HttpContext.Current.Request notation to access the collections.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I am not able to add this namespace
|
|
|
|
|
my class is like this
public myUser ValidateUser(string userName,string password)
{
//validates user with UN and pwd
}
return myUser;
where myUser keeps UN,pwd, emailid
Now i have an aspx.cs page which is getting redirected when teh above class verifies it since above class is used in login page
Now i m getting all teh data in return myUser;
I wnat to use it in the redirected page....
I don't think any viewstate or server variables are needed...is it so...?
|
|
|
|
|
salon wrote: public myUser ValidateUser(string userName,string password)
{
//validates user with UN and pwd
}
return myUser;
Where is this method ? Is this inside the myUser class ?
salon wrote: I wnat to use it in the redirected page....
You can create an instance of the class and use it. If your class is located inside app_code directory or using the same namespace which webpages have, you can use the class directly, else you need to import the namespace to get access to the class.
|
|
|
|
|
yes!
and it is returning values as expected..
Username,password and emailid
I wnat in return myUser;
i need this class in my aspx.cs page which is teh page after redirection
|
|
|
|
|
yeah i m able to access System.Web.HttpContext.Current.Request if i want to get the email address of the current user then what should i use?
|
|
|
|
|
|
If you create an instance of a class, how do you expect that value to be instantiated ? Are you trying to pull it out of the session ? That's where you need to store info about the current user, nothing else is going to persist between pages.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I just need to get data, "POST" from the client side (by javascript with send method) in the page asp.net page with C# code. i have used:
var xmlHttp = GetXmlHttpObject();
xmlHttp.open("POST","SaveInfo.aspx",true);
var args = "id=" + ID + "&name=" + Name + "&sex=" + Sex + "&age=" + Age;
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", args.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.onreadystatechange = function theStateChanged()
{
alert(xmlHttp.status);
if (xmlHttp.readyState==4 && xmlHttp.status==200)
{
alert("Successfully Saved");
}
}
xmlHttp.Send(args);
So, this is the code.
I want to access the args from the page SaveInfo.aspx . how can access that to save those on the database using C# code on this page.
Please help me.
Dipak
|
|
|
|
|
Please don't post same questions in multiple forums.
You can get your answer from here[^] or google[^].
*jaans
|
|
|
|
|
any method to get font-family of string
|
|
|
|
|
meghamaharshi wrote: get
Did you check fontFamily in JavaScript?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
|
foreach (FontFamily ff in FontFamily.Families)
{
if (ff.IsStyleAvailable(FontStyle.Regular))
this.fontbox.Items.Add(ff.Name);
}
fontbox is a combobox here
*** Why EXPERTS behave like a fool ***
|
|
|
|
|
hi.......................
Apply css or write in style
bye......................
Best Regards,
Chetan Patel
|
|
|
|
|
HI,
I am assigning DataTable to gridview as a DataSource like:
DataTable dt=new DataTable();
dt=GetDataTable();
gridView1.DataSource=dt;
gridView1.DataBind();
I want works its reverce... I want to fill a DataTable from gridView DataSource when it is already bind with DataTable.
Like:
DataTable dt=new DataTable();
dt=(DataTable)gridView1.DataSource;
Is this possible?????
Naresh Patel
|
|
|
|
|
hi...........
u have to use view state to store data table
Bye..........
Best Regards,
Chetan Patel
|
|
|
|
|
Hi
I have a search page where a user enters a value in a textbox and then a query is executed to find this value in the database.
The problem I have is that there are two textboxes the user can enter into, a code search and a descriptions search
If the user enters a code that exisits in the dataabase but not a descruotion that matches that code it doesnt bring back any results,
is there a way to amend this so it does?
thanks
|
|
|
|
|
Yes, write your SQL so that it works the way you want it to.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How to open an acrobat image file in a same working window using Asp.net & how to disable all the short keys like saving or copying in opened file.
|
|
|
|
|
you can open a file in the same window by setting the target to _self
Disabling the short keys involves using some javascript, there are plenty of exmaple out there
http://www.arraystudio.com/as-workshop/disable-ctrl-n-and-other-ctrl-key-combinations-in-javascript.html
above might help you
|
|
|
|