.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

logout action problem in IE

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :ASP.Net
I have a login page and a default page to be redirected to after login. when I clicked on thew logout button in the default page it correctly redirects to login page. But when I click the back button in the IE I can again see the protected default page( in mozilla everythng is OK, no problem but in IE this problem occurs).Have I done something wrong. My code r below:login page===========protected void Login1_LoggedIn(object sender, EventArgs e)        {            if (Roles.IsUserInRole(Login1.UserName, "Members")) {               Response.Redirect("users/Member/default.aspx");                //Server.Transfer("users/Member/default.aspx",true);                        }        }===========default page has a LoginStatus button( logout action: RedirectToLoginPage)

View Complete Post

More Related Resource Links

Problem using an action to link to a report in another site

Hi ! I'm using SSRS 2008 with WSS 3.0 (integrated mode) and I want, from a report in a site A, to link to a report in a site B. I'm using the full path to the report and when I paste it in a browser, it correctly shows the report. When I click on the link of the action in the report from site A, a report (having the same name) from site A is displayed instead... Any help would be appreciated Thanks Paul

logout problem(after logout when clicking on back button after logout still opens the previous page

I am using ASP.NET, the web page is abandoning and clear session when a user click logout link but they click the back button and it is still showing the previous page. How can it prevent the previous page after logout?on Logout.aspx load im using this code//=================//        Session.Clear();        Response.Buffer = true;        Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D);        Response.Expires = -1500;        Response.CacheControl = "no-cache";        //----- Second Technique : To Stop Caching of Secure Pages.        Response.Cache.SetCacheability(HttpCacheability.NoCache);        FormsAuthentication.SignOut();        if (Session["UserName"] == null)        {            Response.Redirect("login.aspx");        }       Session.Clear();         Response.Buffer = true;         Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D);         Response.Expires = -1500;         Response.CacheControl = "no-cac

Problem with custom workflow action (SP2010, SPD2010)

We have created an assembly containing 3 custom actions to be used in SPD. Everything works correctly; however every Change and Publish cycle requires me to recreate the lines (steps) containing the custom actions. It is simple mechanical replacement but still is a pain and i would like to figure this out. I've spent considerable time on this already with no solution in sight. Tried clearing out proxy cache (http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/34632798-6e45-4eb3-ad3d-2f941c706cda ) Also checked web.config for non-referenced assemblies.  

Problem with ajax action link



I have code like this. Always the "Get" method is getting called insted of "Post" method eventhough I have explicitly mentioned it as "Post"

<%= Ajax.ActionLink("Create", "Create", new AjaxOptions {HttpMethod = "POST" })%>

What could be the problem ?

Logout problem



I am working on asp.net projects and I am unable to solve logout problem.  I am facing this problem in my every project.  What I always do is, I create logout.aspx page for logout so that when user click on logout, it will redirect to this logout.aspx page where I write code for logout and then It will navigate to index page.  But when we click back button of the browser,  we can view that page. But if we click on any link of that page then it not works and it navigate to index page.  What my problem is after logout why it shows previous page while click on back button of browser?  Here is that code which I wrote in logout.aspx.cs file,

protected void Page_Init(object sender, EventArgs e)

Problem in passing Json collection object from View to Action



I am trying to send json data from view to controller action.  But the issue is the data is not populating in the action parameter List<Score>.

View Model:
public class Score
   public int QuestionId { get; set; }
   public int PrevAnswerId { get; set; }
   public int CurrAnswerId { get; set; }
   public string CurrAnswerName { get; set; }

Json Data look like:
{QuestionId:1, PrevAnswerId:3,  CurrAnswerId:3,  CurrAnswerName:'Known to Broker'},
{QuestionId:2, PrevAnswerId:7,  CurrAnswerId:7,  CurrAnswerName:'Completed'},
{QuestionId:3, PrevAnswerId:10, CurrAnswerId:10, CurrAnswerName:'Report'}

On window load,  I will construct the Json object using "eval()" function and do some operation in the data before its save.

On Save Click, I will call the action through the ajax call.
        url: url,
        type: "GET",
        dataType: 'json',
        data: {score: ScoreJson},

Problem with logout



Initillay my code was working fine when and I was able to logout from the application.

But since the time I have added below line of code, I am not able to logout from the application. The Logout status becomes Login but
I was able to do all the work that a Logged In person can do. I dont know how to handle this please help me. I beleive that Page_PreInit and
and OnInit methods are creating problem but I dont know how to overcome this problem.

protected void Page_PreInit(object sender, EventArgs e)
 Control myControl = null;
            myControl = GetPostBackControl(Master.Page);
            if ((myControl != null))
                if ((myControl.ID.ToString() == "ButtonToAddFileUploadControl"))
                    minimumFileUploadControlCounts = minimumFileUploadControlCounts + 1;

        catch { }

protected override void OnInit(EventArgs e)
        dynamicFileUpload = new FileUpload[minimumFileUploadControlCounts];
        int i;
        for (i = 0; i < minimumFileUploadControlCounts; i += 1)
            FileUpload fileUpload = new FileUpload();
            fileUpload.ID = "myFileUpload" + i.ToString();

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

Virtual Path Problem


 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-


Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"

        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http

Strange Photo upload problem


I'm working project it's live on shared hosting

we'er uploading photos to a file on the server everything works fine the photo is resized renamed and sent to the folder

the upload page returns the thumbnail and the full size photo it's there all the photos have to be approved by an admin

twice now after they have been approved they disapear I checked the folder they are not there could there be anywhere

on the server they could get hung up before they go into the folder I have it setup so when you delete the data base entry it deletes the photo from the folder othe than that you need to open the folder and delete the photo this has hapened twice now I tried to recreate it with no luck

thaks for your help in advance

ASP.Net Caching problem ??


I'm having a problem with an asp.net 3.0 application using a gridview to display data.  The problem seems to be that despite a brand new .selectCommand being sent to the sqlDataSource, the gridview starts displaying data from *someone else's* query.  For example, user A is logged in and will be working fine until a few page submissions later when the gridview data starts suddenly showing information that belongs to another user. 

This is my first asp.net application, though I've been working with classic asp and ADO for years so I'm used to sending a SQL string and getting back the results from that string.  Apparently there is a complex caching system which is interferring which I do not at all understand so at this point I just want to stop the server from caching any data whatsoever.  Is this possible?

Any and all help will be much appreciated!!

Could some one tell me whats the Problem with this String Manipulation ??? C#.net



I store some values from code behind to a label which is Hidden !

<asp:Label ID="lbl_Hidden" runat="server" Visible = "false"></asp:Label>

and at the page load event i retrieve the value of the label & assign it to a string !

stringvalue = lbl_Hidden.Text;

Now i dont know why this manipulation does'nt work !

I've a character 'A' in the string and i'm unable to replace it with a space !

stringvalue.Replace(A, " ");

Wot do u think abt it ????

RaiseEvent problem


I have a parent page ProdView.aspx and two static UserControls, UC1 and UC2. Each UC is in an Ajax accordion pane and the accordion inside an updatepanel.

UC1 has a Gridview footer with couple of textboxes and a link button that fires an Add Row insert procedure. I want to Raise an event that will rebind the UC2 after the row insert in UC1.

First I created the sub delegate and event in UC1:

  • Public Delegate Sub MyRefresh(ByVal sender As Object, ByVal e As CommandEventArgs)
  • Public Event Refresh_UC1 As MyRefresh

In the same UC1 the Insert procedure that fires the insert and RaiseEvent:

Sub PricingGrid_Insert(ByVal sender As System.Object, ByVal e As EventArgs)
       Dim myConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString)
       Dim myCom As SqlCommand = New SqlCommand("AddRow", myConn)
       myCom.CommandText = "AddRow"
       myCom.CommandType = CommandType.StoredProcedure


Gridview Enable Selection Problem



I have a gridview with Enable selection and Enable Paging equals to TRUE.

I also set the PageSize of my gridview to 4 so that I only displays 4 rows per page.

The problem is when I click the pager in the bottom of my gridview, my gridview is disappearing and no records appear.

Here is code behind of my gridview:

If e.Row.RowType = DataControlRowType.DataRow Then
                e.Row.Attributes("style") = "cursor:pointer"

                e.Row.Cells(2).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(3).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(4).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(5).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))
                e.Row.Cells(6).Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" & e.Row.RowIndex.ToString))

pass value from textbox to action, formcollection best way here?


Hi I'm building a e-commerce store and on quantity of product I'm going with a textbox. I thought I would ask how would you do this? a viewmodel to use a strongly typed textbox or just get the value of the textbox from the formscollection passed in to the action?

Thanks for any input

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend