473,503 Members | 8,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I hate to ask, but...

I'm used to windows forms programming. Just tackling something in asp.net as
a web app - I have got to the point where I have a login form that works,
and on the resulting page I have a loginview. That page has a design layout
and a source layout, then I also have a code layout. In the code layout I
have written a function that only should be called if the user is logged in,
so, in the source for the page, how do I call my function in the "loggedin"
template of my LoginView?
I tried wrapping it in <code> tags but it just displays the name of the
function...

James.
Jun 30 '06 #1
3 1081
James,

How are you doing the login? Are you providing a custom membership
provider? ASP.NET 2.0 has a rich provider interface that will let you
create your principal (implementation of the IPrincipal interface) and
expose it to your pages.

Then, you would just check the User property on your page and if it is
null, you know the person is not logged in.

Check out the following article on forms authentication, it should help:

http://aspnet.4guysfromrolla.com/articles/120705-1.aspx

You can also check out the documentation in MSDN on implementing a
membership provider:

http://msdn2.microsoft.com/en-us/library/f1kyba5e.aspx

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"james" <ja***@com.com> wrote in message
news:44**********************@news.zen.co.uk...
I'm used to windows forms programming. Just tackling something in asp.net
as a web app - I have got to the point where I have a login form that
works, and on the resulting page I have a loginview. That page has a
design layout and a source layout, then I also have a code layout. In the
code layout I have written a function that only should be called if the
user is logged in, so, in the source for the page, how do I call my
function in the "loggedin" template of my LoginView?
I tried wrapping it in <code> tags but it just displays the name of the
function...

James.

Jun 30 '06 #2
Cool down man, watch the video here might help you:
http://www.asp.net/Default.aspx?tabid=1

chanmm

"james" <ja***@com.com> wrote in message
news:44**********************@news.zen.co.uk...
I'm used to windows forms programming. Just tackling something in asp.net
as a web app - I have got to the point where I have a login form that
works, and on the resulting page I have a loginview. That page has a
design layout and a source layout, then I also have a code layout. In the
code layout I have written a function that only should be called if the
user is logged in, so, in the source for the page, how do I call my
function in the "loggedin" template of my LoginView?
I tried wrapping it in <code> tags but it just displays the name of the
function...

James.

Jun 30 '06 #3

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ul**************@TK2MSFTNGP05.phx.gbl...
James,

How are you doing the login? Are you providing a custom membership
provider? ASP.NET 2.0 has a rich provider interface that will let you
create your principal (implementation of the IPrincipal interface) and
expose it to your pages.

Then, you would just check the User property on your page and if it is
null, you know the person is not logged in.


Thanks - page.user.identity was exactly the area I was looking for. All
seems working now, thanks for the help!
James.
Jun 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
1668
by: in | last post by:
I hate static variables and methods. Hate them. HATE THEM AAAAAAAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!!!!!!!!!!!
7
1513
by: Alexa | last post by:
Hi Everyone, As a user, which ad format you hate the most and which you like the most? A) Top banner B) Google AdSense C) In-content rich media box D) Vibrant Media IntelliTxt I will...
92
7552
by: Jeffrey P via AccessMonster.com | last post by:
Our IT guys are on a vendetta against MS Access (and Lotus Notes but they've won that fight). What I can't understand is, what's the problem? Why does IT hate MS Access so much. I have tried...
10
363
by: in | last post by:
I hate static variables and methods. Hate them. HATE THEM AAAAAAAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!!!!!!!!!!!
40
3080
by: PJ6 | last post by:
I want to rant, but I'm too busy at the moment. Who else hates working in C#? What's your biggest pet peeve? Paul
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7291
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7357
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5598
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
402
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.