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

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

How do I get Previous Page's URL?

Posted By:      Posted Date: October 20, 2010    Points: 0   Category :ASP.Net

I want to make a Return column visible on my GridView based on a condition, but I want the NavigateUrl to be the previouspage URL plus the ID that I am sending back to that page.

Currently, I use this:
Dim previousPage As String = Page.Request.UrlReferrer.ToString

This gives me the previous referral page's URL, BUT... if I hit Find to search for something and then the search lists to my GridView, previousPage errors with a Object Not Set to Instance, etc. Error. Why is this? And does anyone have a way of grabbing the previous page URL?

View Complete Post

More Related Resource Links

Retrieving a variable from a previous page



I'm looking to have a search page where a user will select an item from a listview, then then taken to another page that wil display data based on their original selection.

A user will type in a string and be presented with a list of usernames that are like that string, when they select a user name who's profile they would like to view I would like the page that they're taken to, to be that users profile.

How would I transfer the variable from the search page to the profile page, and when I work on the profile page, how can I access that variable?


Retrieving values from previous page

Hey Forumers,Here is the case, I have a datalist displaying a whole list of text files and I have a hyperlink with the title as the text and a navigateUrl that navigates the user to a page to display the file the user chose.I have coded the hyperlink like so:<asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("Title") %>' NavigateUrl='<%# Eval("StoryID", "StoryDisplay.aspx?StoryID={0}") %>'>Hyperlink</asp:HyperLink>The problem I am facing is that I got this code snippet from another source and I don't know what does the StoryID={0} means. I do know that the eval statement would sent the storyID of the selected file to StoryDisplay.aspx, I just don't know how to retrieve the values from the second page.P.S. the second page contains a title label and an area(enclosed in <div> tags) for the selected text to be displayed.Please help and thanks in advance =)Cheers,Zephere

ASP.net Web Site Administration Tool. An error was encountered. Please return to the previous page a

I have just installed Visual Studio 2010 trial. Previously I have been using Visual Studio Web Developer 2010 Express. Now every time I try to invoke the ASP.net Cofiguration tool either via the icon or through the Project File Menu item, I get the error message "An error was encountered. Please return to the previous page and try again." I am trying to develop a bog standard Silverlight Business Application. There are no other diagnostics. Is there anywhere I can look for more clues or anything else to do to alleviate the problem? or is this something peculiar to the trial version I am using?   I also think it might have something to do with the fact that I have created this Silverlight Business App on a directory on my D: drive and not the normal, default c: drive path and maybe the web sit admin tool is looking somewhere else. Could this have something to do with it? If so what is my remedy?   Help please.....

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

Recover data on a Previous Page after navigating from the page and navigating back

How can i recover the data on Page1 after navigating to Page2, so that when i navigate to Page1 from Page 2 i want the unsaved data as is.

Retrieve Previous State Data on return from another page


I have a list page having date in repeater control. And also having some search criteria on the page. Using that I filter the data on the page. Now in repeater I have Edit button. Which allows me to open that record details in another page.
When I come back to list after saving or cancel, the filtered data is gone. I want to keep that filtered record with selected values in filter controls (checkbox, dropdown etc).
I have two options in my mind 1) Session, 2)

After Login , Redirect To Previous Page Instead Of Destination URL set


Hi .

I have developed an asp.net project with asp.net membership for login.

I have login control in a page and for that I have set the property destination URL to a particular page say defaultlogin.aspx.

It is also working fine, when I use to login from home page.

But if i navigate to different pages of my website say first to home page, contact us page, about us page etc. Then after that when I click on login page and key up the login information in the login control.

I use to redirect to the last page which I have visited the last. It is not redirecting to the destination page which I have set in the login control.

What's the problem here?

Plz help me with the above issue.

Thanx in advance.

while running new report, doesn't indicate if previous report preview page is open



i am using asp.net to run the reports from the parameter page.

When i run a report by passing report parameters, the reporting services report opens in the report_preview.aspx page.

 Now, if i do not close this report_preview.aspx page and go to new parameter page and run another report, the report_preview.aspx page doesn't show the new report. It just refreshes the old report.

This can be because, when the run button of any parameter page is executed, it opens the report_preview.aspx page by executing the following query under page_load button.

            ScriptManager.RegisterStartupScript(this, typeof(string), "openNewWindow", "window.open('../Report_Preview.aspx','ReportPreview','scrollbars=yes,resizable=yes,')", true);

But clients get confused for everytime to close previous preview page and open the new report.

IS there any way to handle it please

Is there any way to generate the new ssrs report on the same report_preview.aspx page by refreshing it ( by replacing previous report by the new one) ?


Load Previous ASPX Page while click on Javascript History.Back


Hi All,

I am stuck with a unusual Scenario, I have Default.aspx page which contains a Search criteria option and Gridview, After doing particular search result is displayed in Gridview .

When i click on selectedindexchanged event of Gridview it takes me to another page called Details.aspx where there is form in edit mode where the user can update and save the data into a database . In Details.aspx page i have link button which have history.back function which takes me to default.aspx page where i can retain my Search criteria and Gridview Result but my query is when click on Link button i want to call any of the Events of Default.aspx page.

Thanks in Advance


default ASPX Publishing page will not restore to previous version

I have inherited a MOSS farm that has a semi customized front page on it's publishing portal. One of the customizations is a bamboo web part that someone did something to to cause it to change the font on it to white and collapse if it had no information in it. I restored this whole site collection to a test area in a separate application pool so that I could work on it without disturbing any other users.  The Bamboo licensing broke in this web application even though the farm is licensed. I was just going to ignore that for now and concentrated on adding some web parts controlled by audiences. I got the web parts in and reacting to the correct audience but then I screwed around with it long enough to break it.

Now the customized Bamboo does not collapse and is stuck showing it's error message about the licensing, and I am unable to change the height of other web parts although I am able to change the width.

So (and here is the real problem) I thought that I would just restore a previous version of the page and try again after I got the licensing with Bamboo all straightened out. But I cannot get this page to restore an old version.

First when I was on the page showing all of the versions for this page and I would choose an older version it would complain that I had to check out the page before making any changes. SO I check out the page and return

Getting First record in Nextpage and last record of previous page of gridview



I am using paging to my  gridview (pagesize=4) . now i am in  (X) page and i want to get  (X+1) page top record or (X-1)page  bottom record , how i can get .


Non-updatable page fields in the previous pages when clicked on back button.



I have the  following scenario.

I have four pages and user enters certain information and navigates to  the next page. In the last page, when user clicks on submit button it will redirect him to the confirmation page. Once the user is in the confirmation page and clicks on back button, all the fields in the previous pages must be non-updatable.

Note: User can use the back button to view his previous data but not-updatable anymore.

Can you please post some code for the above scenario ?

How to show previous page total in current page?


I have a problem that I want to show total of previous page in current page.

I have a table that I show sum  of page in page footer. but i can not show that in next page.

I tried any way but I can do that in reporting service 2008.


Please help me as soon as possible.


Please Help Very Very Important ,, how to show filed from previous page


how to show field from previous page?

please please please

I have two pages

1-main (first page)
2-mat (second page)

there is database filed in main (Major) i want to show it in label in the next page (mat)



code of main

<%@ Page Language="VB" EnableSessionState="True" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script language="VB" runat="server" id="LoginInfo2">


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

        L1.Text = Session("Login_Page")
    End Sub

<form id="form1" runat="server">
    Welcome To The User:
    <asp:Label ID="L1" runat="server" Text="Label"></asp:Label>

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
    DataKeyNames="ID" DataSourceID="AccessDataSource1"
    EmptyDataText="There are no data records to display.">
        <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True"
            SortExpression="ID" InsertVisible="False" />
        <asp:BoundField DataField="Std_Name" HeaderText="Std_Name"
            SortExpression="Std_Name" />
        <asp:BoundField DataField="Std_Num" HeaderText="Std_Num

Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Using jQuery to directly call ASP.NET AJAX page methods

Here I am looking to explain how to call page methods using jQuery. Using jQuery to directly call ASP.NET AJAX page methods

Reduce ASP.NET Page size and complexity using JQuery

This is my first post on asp.net blog. ASP.NET Ajax and JQuery are two different ajax framework. In this post I will show, how we can enhance gridview using ASP.NET Ajax and JQuery. I also compare the implementation of these frameworks. In next posts i will explain more about JQuery and ASP.NET Ajax and also tell you "How to combine the power of both framework". My Future post will related to ASP.NET and related frameworks.
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