|
Dear all,
I have the following configuration for my sessionState:
<sessionState mode="InProc" cookieless="UseCookies" timeout="10" >>
It works fine, but there is one thing i don't understand.
When i open multiple tabs, all tabs have the same SessionID, but they don't time out at same time.
I thought that all tabs share the same session, so they have to have also the same timeout
What i want is that ofter session timeout occurs, to logout the user from all opened tabs at the same time.
But in my situaion, when two tabs are open, the first one logs the user out, but not from the second tab. On the second tab, the user still can work.
This is my code to logout and redirect the user ofter session timeout:
protected void Session_Start(object sender, EventArgs e)
{
if (Context.Session != null)
{
if (Context.Session.IsNewSession)
{
string sCookieHeader = Request.Headers["Cookie"];
if ((null != sCookieHeader) && (sCookieHeader.IndexOf("ASP.NET_SessionId") >= 0))
{
FormsAuthentication.SignOut();
HttpContextBase httpContext = new HttpContextWrapper(HttpContext.Current);
UrlHelper urlHelper = new UrlHelper(new RequestContext(httpContext, new RouteData()));
string redirectUrl = urlHelper.Action("LogOn", "Account");
httpContext.Response.Redirect(redirectUrl);
}
}
}
}
How can i solve this issue?
Thanks in advance.
|
|
|
|
|
Does this help?[^]
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
I want to upload image and immediate open it without database connection in asp.net c# programme?
|
|
|
|
|
|
hi
when click on edit button,I allow to update 2 columns.I want cell text of these colums should be null means user insert a new value.
how it is possible?
I used on editing event
protected void jgjgj(object sender, GridViewEditEventArgs e)
{
int index = e.NewEditIndex;
GridViewRow row=GridView4.Rows[index];
row.Cells[4].Text = "";
row.Cells[5].Text = "";
this.Modalpopupextender1.Show();
}
but it is not working.
|
|
|
|
|
Once you assign new edit index, you have to bind the grid again. then later access the controls and assign the values to that. check this..
GridView4.EditIndex = e.NewEditIndex;
GridView4.Datasource = yourDataSource;
GridView4.DataBind();
GridViewRow row = GridView4.Rows[4];
TextBox txt = (TextBox)(row.FindControl("TextBoxID"));
txt.Text="";
txt = (TextBox)(row.FindControl("TextBoxID2"));
txt.Text="";
with regards
Karthik Harve
|
|
|
|
|
I do not have textbox control.where to find TextBoxID?
|
|
|
|
|
Try to this one:
GridView4.EditIndex = e.NewEditIndex;
string str = GridView4.DataKeys[e.NewEditIndex].Value.ToString();
GridViewRow row = (GridViewRow)grvCompType.Rows[e.NewEditIndex];
row.Cells[1].Text = "";
|
|
|
|
|
this is same as my efforts.see question again.
|
|
|
|
|
I'm Developing an Application. In that I have using a Flash file uploader (Asynch) for changing User Images. But after uploading The Image is taken from cache I have tried so many things to resolve this issue like
<%@ OutputCache Duration="5" VaryByParam="None" %>
then
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now);
But Still couldn't resolve this issue
|
|
|
|
|
Hello All,
I am very new to this avenue of ASP.NET. Yet, I am focussing on building a discussion forum(web based) using ASP.NET. I am told that there are ready made wiki templates which can be used to achieve this.
I searched on the net and did find some templates but don't know how can I use them and embedd those in my .aspx pages. Can someone provide me a link or a two which I can study and implement the scenario?
Thanks in advance...
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
I was expermenting with Area's, and even after following the various guides and registering the routes using the Namespace parameter, I'm still get the Naming Conflict on the HomeController.
The request for
ANSLWebToolkit.ANSLWebToolkit.Areas.Operations.HomeController
ANSLWebToolkit.ANSLWebToolkit.Controllers.HomeController
So, I created a new MVC project in VS2010. I then created a new Area called "Operations", then added a new "Home" controller under this new area.
According to all the docs, having controllers in each area (or the root) with the same name is perfectly acceptable, providing you register the routes using the Namespace parameter. So the clash I'm getting is on the default HomeController (original non-area) and the Operations area HomeController.
I have checked the controller and the route registration sections, and all appears to be fine;
The global.asax file;
Public Class MvcApplication
Inherits System.Web.HttpApplication
Shared Sub RegisterGlobalFilters(ByVal filters As GlobalFilterCollection)
filters.Add(New HandleErrorAttribute())
End Sub
Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
New With {.controller = "Home", .action = "Index", .id = UrlParameter.Optional},
New String() {"ANSLWebToolkit.Controllers"}
)
End Sub
Sub Application_Start()
RegisterGlobalFilters(GlobalFilters.Filters)
RegisterRoutes(RouteTable.Routes)
AreaRegistration.RegisterAllAreas()
Debug.WriteLine("Registered Route Table: ")
For Each item As Route In RouteTable.Routes
Debug.WriteLine(item.Url)
Next
End Sub
End Class
The default HomeController;
Namespace ANSLWebToolkit.Controllers
Public Class HomeController
Inherits System.Web.Mvc.Controller
Function Index() As ActionResult
ViewData("Message") = "Welcome to ASP.NET MVC!"
Return View()
End Function
Function About() As ActionResult
Return View()
End Function
End Class
End Namespace
The OperationsAreaRegistration class
Namespace ANSLWebToolkit.Areas.Operations
Public Class OperationsAreaRegistration
Inherits AreaRegistration
Public Overrides ReadOnly Property AreaName() As String
Get
Return "Operations"
End Get
End Property
Public Overrides Sub RegisterArea(ByVal context As System.Web.Mvc.AreaRegistrationContext)
context.MapRoute(
"Operations_default",
"Operations/{controller}/{action}/{id}",
New With {.action = "Index", .id = UrlParameter.Optional},
New String() {"ANSLWebToolkit.Areas.Operations"}
)
End Sub
End Class
End Namespace
Anybody see what is wrong or how can I work out why even when using the namespace parameter, it still clashes. As you can see I put some debug to dump the route registration table and it is doing what it should;
Registered Route Table:
{resource}.axd/{*pathInfo}
{controller}/{action}/{id}
Operations/{controller}/{action}/{id}
Any help appreciated, I'm going loopy with this basic error!
|
|
|
|
|
A "friend" of yours downvoted this, so I've compensated to put visibility back to a reasonable level.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
A new Schema importer extension was created to return a Forum object instead of Book object when invoking Select method of a web service.When running a asp.net web page that invokes the Select method of the web service(which returns Book object) the WriteXml method of Book class(original type returned by web service method) is invoked and the object Serializes itself there and then ReadXml method of Forum class(new type registered by schema importer) is invoked but the XmlReader parameter does not contain actual data :
void IXmlSerializable.ReadXml(XmlReader reader)
{
this.title = reader.GetAttribute("title") + " by " + reader.GetAttribute("author");
this.bookID = reader.GetAttribute("bookID");
}
reader.GetAttribute("title") and reader.GetAttribute("author") return null and finally the Forum object returned from Select method of the web service contains empty fields ?
Am I missing something in implementing this Schema importer extension?
|
|
|
|
|
Hi,
How to upload all the files from a folder in a button click.
eg: there is a folder in the client system with some files, from a button click i need to upload all the files from that folder.
is it possible in asp.net or javascript.
or will it possible if the folder is in the server where the files are published.
Thankyou,
YPKI
|
|
|
|
|
Because of security issue we don't have any control on accessing files/folders on client system.
|
|
|
|
|
Hi,
In master page i have header,menu,content placeholder and footer.On click of each menu items the header and footer are refreshing.i had enclosed the code and css file.
The header and footer must be fixed only the contents must change.Need help.
IFrame makes performance issues.
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Main.master.cs" Inherits="Main" %>
<%@ Register Src="~/Menu.ascx" TagName="HeaderMenu" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
<%-- <tr>
<td>
<table id="Table1" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="headerleft">
<img alt="left" src="Images/PortalBanner_Left.gif"/>
</td>
<td id="Td1" class="bannerimg">
<img alt="" src="Images/Logon_Header_Image_SCF3.jpg" style="width:450px;height:50px" />
</td>
<td id="headerright">
<img alt="right" src="Images/PortalBanner_right.gif" />
</td>
</tr>
</table>
<table class="bannerimg" border="0" width="100%">
<tr style="font-size:small; width: auto; ">
<td style="text-align: left; padding-removed 10px">
<asp:Label ID="lblWelcome" runat="server" Text="Welcome " CssClass="hrefClass"></asp:Label>
<asp:Label ID="lblUser" runat="server" CssClass="hrefClass"></asp:Label>
</td>
<td style="width: auto; text-align: right;">
<asp:LinkButton ID="lnHome" runat="server" class="hrefClass" CausesValidation="false" >Home</asp:LinkButton>
<asp:LinkButton ID="lnLogout" runat="server" class="hrefClass"
CausesValidation="false" >Logout</asp:LinkButton>
</td>
</tr>
</table>
</td>
</tr>--%>
<div id="header">
<p><a href="http://blog.dampee.be/">Techspace</a>
<img src="Images/Logon_Header_Image_SCF3.jpg" alt=""/>
</p>
<span>About technology</span>
</div>
<tr>
<td colspan="3">
<div id="menu">
<uc1:HeaderMenu id="HeaderMenu1" runat="server"></uc1:HeaderMenu>
</div>
</td>
</tr>
<tr>
<td colspan="3" style="vertical-align: top; height:600px; width: 100%; background-color: White;">
<div id="content">
<div class="middle_blk">
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
</td>
</tr>
</table>
<div id="footer">
<div class="footer_blk">
<div class="middle_blk">
<img src="Images/PoweredByASPNET.gif" alt="Powered by ASP.NET!" />
</div>
</div>
</div>
</form>
</body>
</html>
Thanks
S.Guhananth
|
|
|
|
|
you have already discuss for same
|
|
|
|
|
that did not work out,so that only posted again.
|
|
|
|
|
Hi,
You can put update panel for stop refresh master page.
|
|
|
|
|
Hi,
That idea will of using update panel will keep content page without refresh.
But,I want the header and footer to be fixed.I had tried but not working,
Plz help.
Thanks
S.Guhananth
|
|
|
|
|
|
hi friends
i am creating a signupform wherein there is a text area where by the user on the click of the text area he enters an editor and so what ever he types in the editor will be back in the textarea so how to do it...what editor to have...how to invoke the editor...
how to get the editor...
can anyone help me..
K.Gayathri
|
|
|
|
|
hi friends
i am using ajaxtoolkit...i am using editor from the toolkit
i need to know how to invoke the editor on the click of a textarea...
anyone to help me plz............
K.Gayathri
|
|
|
|
|
Is there any problem for adding Editor instead of textarea?
|
|
|
|