The server tag is not well formed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All
I'm adding some variables on Session on start mothod as given belo

protected void Session_Start(Object sender, EventArgs e

Session.Add("UserID",string.Empty)
Session.Add("isAdmin",false)
Session.Add("isLoggedIn",false)

on a Webform I'm try to access the variables as given below
if(Convert.ToBoolean(Session.Contents["isLoggedIn"])
Response.Redirect("WebForm5.aspx")

No even though I remove the above code it prompts the error lik

The server tag is not well forme
it aslo shows the message that unicode characters in this file will not be saved

Am I doing any mistakes in accessing the session variable on webform

thanks in advanc

Da
 
Hi Das
try to add object to the session object his way
Session("UserID")= "whatever or even nothing";
andget the value this way
retrived_value = (you might need to do custing here
)Session("Storedvalue");
hope that helps

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top