PC Review


Reply
Thread Tools Rate Thread

echo for a session variable

 
 
=?Utf-8?B?Q3JhaWc=?=
Guest
Posts: n/a
 
      16th Aug 2005
I'm used to PHP. If I wanted to have a link with variables, I'd do
something like this in the html:
mysite.com/?user=<?php echo $myUser ?>

What's the best way to do this in ASP.NET
1. How do I do an Echo for a Session variable.
2. is it best design to do this in the html <% here %> or in the code behind?

Thanks
 
Reply With Quote
 
 
 
 
John
Guest
Posts: n/a
 
      16th Aug 2005

"Craig" <(E-Mail Removed)> wrote in message
news:72C8386E-40F6-4F5A-8A05-(E-Mail Removed)...
> I'm used to PHP. If I wanted to have a link with variables, I'd do
> something like this in the html:
> mysite.com/?user=<?php echo $myUser ?>
>
> What's the best way to do this in ASP.NET
> 1. How do I do an Echo for a Session variable.



mysite.com/?user=<%=myUser%>


> 2. is it best design to do this in the html <% here %> or in the code
> behind?


It's really a preference thing.

Personally;
-if it's a simple page .. <%=myUser%> might be ok
-anything bigger, I would probably use code behind.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a Session variable that identifies the session. AAaron123 Microsoft ASP .NET 14 11th Sep 2009 08:17 AM
System Session Variable VS. Own-declared 'Session' Variable chowchho Microsoft ASP .NET 4 28th Mar 2008 02:07 PM
NF325-A7 Sound problem: sounds like an echo ,,echo...echo makes me crazy...crazy...crazy...help...help...help David Sontag DIY PC 17 30th Nov 2007 06:45 AM
SqlConnection Object in Application Variable OR Session Variable OR open/close pratham Microsoft ASP .NET 3 31st Aug 2006 08:26 PM
Datalist - how (if) to use a sub variable or session variable in the footer? KathyB Microsoft ASP .NET 1 17th Jul 2003 02:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:25 PM.