|
Let me first understand the problem here -
First, you had not validated the session on the main page hence when you entered the URL the main page was displayed.
So, you validated the session variable and redirected the user to Login page.
Now on the login page only after you sign-in you are able to go to the main page.
Now you wish to log-out the user for which you use session["UserName"] = null; but the main page still goes thro'.
Am I correct?
The problem here is that you should not use session["UserName"] = null; to remove the session variable. You should use Session.Remove("UserName");
HTH!
|
|
|
|
|
ok...
tried but wont work..
|
|
|
|
|
1. How do you check the Session variable on the main page? If possible post the code here.
2. Does the user actually click the Logout button/link?
|
|
|
|
|
1.) if (Session["UserName"] == null)
{
Response.Redirect("Login.aspx");
}
this in main.aspx page_load
2.)sure and the code to logout is :-
//Session["UserName"] = null;
//Session.Abandon();
Session.Remove("UserName");
Response.Redirect("Login.aspx");
|
|
|
|
|
Did you step thro' and check what happens in the Page_Load on the main page. Check if Session["UserName"] evaluates to null or if it returns any other value.
Are you checking this with-in a IsPostBack check? Can you post the entire Page_Load code?
Can you re-phrase what is happening against what is expected?
|
|
|
|
|
thank u for your consideration but i managed to solve out the problem through emptying the buffer..
|
|
|
|
|
Please check if session is removed properly..
Check
Session.Remove("UserName");
var session = Session["UserName"];
Check what you see in the session variable. If it is null, I think the session is somewhere created. If you can see the value of session, it is indeed not clearing out properly.
Are you using webdev environment. I recommend you to try this in the IIS.
|
|
|
|
|
How to assign syle to the row of a gridview at runtime.
|
|
|
|
|
attache event with the row created event and than
do code as below here is code of attaching event but you can do anything you want to do with the row here
protected void grduser_RowCreated(object sender, GridViewRowEventArgs e)
{
Anthem.GridView datagrid = ((Anthem.GridView)sender);
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.cursor='pointer';this.style.font.weight='bolder';");
}
}
modified on Tuesday, January 5, 2010 3:41 AM
|
|
|
|
|
It would be like this
protected void GridView1_OnRowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (((e.Row.RowIndex+1) % 2) == 0)
{
e.Row.BackColor = System.Drawing.Color.Gray;
}
}
}
This will change your alternative Row color. The main thing is that you need to use OnRowCreated method.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
You can set the TR's className by JS, for example:
function initTableTrColor(tabId, style1, style2){
var tabobj = document.getElmentById(tabId);
var trArray = tabobj.getElmentByTagName("TR");
for(var i=0; i
modified 27-May-14 5:05am.
|
|
|
|
|
Hi,
I am taking a project from vss. following are the steps which i am following:
1) opening microsoft visual sourcesafe 6.0
2) set working folder in c:\inetpub\wwwroot\folder_name
3) get latest version recursive.
after this process, i try to open the project in microsoft visual studio by clicking on the solution file created for the project from c:\inetpub\wwwroot\folder_name, but it again asks me to create a folder with the same project name and again it generates all the files in the newly generated folder. the folder hierarchy goes like this:
c:\inetpub\wwwroot\folder_name\folder_name and the files.
Sandeep Kumbhar
|
|
|
|
|
You can try this :
Copy you project first and than set this as working folder
and than do get latest operation
not sure but you can try above may it resolve problme becasue it worked for me once
|
|
|
|
|
hi,
i am not getting the line, Copy the project .what to do exactly?
thanks,
Sandeep Kumbhar
|
|
|
|
|
Hi
First open your visual studio.
1.File menu-->open-->open project/Solution-->open project window will open.
2.Open project-->click on Source safe-select vss from the network-
3.Give u r username and password and select your project.
your's subbu
|
|
|
|
|
I am new to web appliations development. I am suing ASP.Net 2.0 / VS2005. I had the user credentials in XML file. I have two different menuWebPage with 2 diff sitemaps, which displayes the menu for two different logins. and made the chages in web.config as below,
<siteMap defaultProvider="sitemap1" enabled="true">
<providers>
<add
name="sitemap1"
type="System.Web.XmlSiteMapProvider"
siteMapFile="~/XYZ/XYZWeb.sitemap"/>
<add
name="sitemap2"
type="System.Web.XmlSiteMapProvider"
siteMapFile="~/ABC/ABCWeb.sitemap" />
</providers>
</siteMap>
And changed SiteMapProvider="sitemap1" / SiteMapProvider="sitemap1"on the webpages
But Treeveiw control looks like below on the web page in Desing/run view as well
- Root
- Parent
Sibling node1
- Current node
-Child node1
-Child node2
UsersXML file
==============
<Staff>
<User>
<username>User1</username>
<password>User1pw</password>
<Role>Admin</Role>
</User>
<User>
<username>user2</username>
<password>user2pw</password>
<Role>SuperUser</Role>
</User>
</Staff>
Please advice.
|
|
|
|
|
How to resolve quot xml parsing issue by using C# .net. For example, I have this node:
<code>
&lt;description&gt;&amp;#60;p&gt;&amp;#60;a href="http://us.rd.yahoo.com/dailynews/rss/tech/*http://news.yahoo.com/s/afp/20091230/ts_alt_afp/usitcomputersecurityinternetmcafee"&gt;&amp;#60;img src="http://d.yimg.com/a/p/afp/20091230/capt.photo_1262191861138-1-0.jpg?x=130&amp;amp;y=84&amp;amp;q=85&amp;amp;sig=XB8VuNiiCtOC5TYh6H441w--" align="left" height="84" width="130" alt="The logo of social networking website &amp;#39;Facebook&amp;#39; is displayed on a computer screen. &amp;quot;The explosion of applications on Facebook and other services will be an ideal vector for cybercriminals,&amp;quot; McAfee said.(AFP/File/Leon Neal)" border="0" /&gt;&amp;#60;/a&gt;AFP - Social networks will face increasingly sophisticated hacker attacks in 2010 but law enforcement is expected to make strides in fighting cybercrime, according to Web security firm McAfee Labs.&amp;#60;/p&gt;&amp;#60;br clear="all"/&gt;&lt;/description&gt;
</code>
and the string either
<code><u>&amp;#39;Facebook&amp;#39; </u></code>
or the string
<code>
<u>quot;The explosion of applications on Facebook and other services will be an ideal vector for cybercriminals,&quot; </u>
</code>
is causing the page to fail the validation by HTML validator. Some of the errors about the specific lines are:
<pre>
#
* Line 378, column > 80: XML Parsing Error: attributes construct error
&/s/afp/20091230/ts_alt_afp/usitcomputersecurityinternetmcafee"><img src="http&
* Line 378, column > 80: XML Parsing Error: Couldn't find end of Start Tag img line 378
&/s/afp/20091230/ts_alt_afp/usitcomputersecurityinternetmcafee"><img src="http&
# Error X is not a member of a group specified for any attribute
* Line 378, column 374: "The" is not a member of a group specified for any attribute
&isplayed on a computer screen. "The explosion of applications on Facebook and
* Line 378, column 384: "explosion" is not a member of a group specified for any attribute
&n a computer screen. "The explosion of applications on Facebook and other ser
* Line 378, column 387: "of" is not a member of a group specified for any attribute
& computer screen. "The explosion of applications on Facebook and other servic
* Line 378, column 400: "applications" is not a member of a group specified for any attribute
&een. "The explosion of applications on Facebook and other services will be an
* Line 378, column 403: "on" is not a member of a group specified for any attribute
&. "The explosion of applications on Facebook and other services will be an id
</pre>
I have tried codes like
<code>
mystring = str.Replace( "&apos;", "'" );
mystring = str.Replace( "&quot;", "\"" );
</code>
But these two lines are generating more errors. Please tell me or give me suggestions what you know about this specific issue of validating where ' is involved. You can find the rss file at http://rss.news.yahoo.com/rss/tech
|
|
|
|
|
Try this
Everything inside a CDATA section is ignored by the parser.
A CDATA section starts with "<![CDATA[" and ends with "]]>":
so put your xml string in cdata section it resolve your error because parser ignore your data which is in your cdata section
|
|
|
|
|
I have used following code on my button click
Code:
Response.Redirect("http://www.microsoft.com/gohere/look.htm");but the problem is i have to click 2 times for nevigation.
when i clicked for fitst time it just refresh the page ...and second time it actually nevigates the page...
what should i do ???....
i have tried Anchor, LinkButton but failed...........
thanks in advance.....
Rating always..... WELCOME
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
try using server.transfer...check ispostback property
|
|
|
|
|
Try checking if your button's AutoPostBack = true.
modified 27-May-14 5:06am.
|
|
|
|
|
Hi All,
I am using VS 2008, 3.5 and am trying to add drag and drop functionality to the treeview. However, the allowdrop property is non existent on the treeview control.
I am baffled as to why this is the case.
Even when Ive instantiated the control it is neither existant nor does it appear behind the server control. help is much appreciated.
Kind Regards
|
|
|
|
|
|
Hello, I've been working on an e-commerce site for a couple of weeks. I'm at a point where I want to use a datalist to display a subset of my catalog. Well, nothing in the datalist displays when I bring up the page in IE with either IIS 7 or VS built-in iis server.
I've isolated a simple piece of code that illustrates my dilemna within a defalut.aspx file:
<form id="form1" runat="server">
<div>
<asp:DataList ID="DataList1" runat="server">
<ItemTemplate>
Hello!
</ItemTemplate>
</asp:DataList>
</div>
</form>
This page should show: "Hello", yet the page is blank. More configuration details:
- running Windows 7
- VS 2008
- IIS 7
Any assistance or suggestions to point me in the right direction would be greatly appreciated. Thanks in advance.
|
|
|
|
|
on page loadon the server side , you are missing the following code
DataList1.DataBind();
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|