Last post Nov 10, 2009 01:57 PM by ankit_ddit
Nov 09, 2009 03:05 PM|ankit_ddit|LINK
how can i get this.
Nov 09, 2009 03:53 PM|lnr.dinesh|LINK
Use document.referrer to identify how this page is accessed. It returns empty string if page is directly accessed
Hope this Help
Nov 09, 2009 03:57 PM|atifsarfraz|LINK
hit the back button the variable should be true and window.onload shouldn't execute.
Nov 09, 2009 03:59 PM|ankit_ddit|LINK
Thanxs for reply,
would you plz explain me with example. I also call
Sys.WebForms.PageRequestManager.getInstance()._doPostBack(GetObj(btnSave', 'false'), ''); in the window.onload function
Nov 09, 2009 04:06 PM|ankit_ddit|LINK
Thanxs For Reply. I tried document.referrer its not good in my condition.
I have two page and both page have window.onload event function. when i go from one page to another page with back/forward button, it give me referrer url. it wont empy.
Nov 09, 2009 05:54 PM|atifsarfraz|LINK
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="B.aspx.cs" Inherits="Practice.B" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
var exec = document.getElementById("OnLoadExecuted").value;
if(exec != 'True')
document.getElementById("OnLoadExecuted").value = 'True';
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
<input type="text" id="OnLoadExecuted" value="False" />
Nov 09, 2009 05:55 PM|atifsarfraz|LINK
Just set the OnLoadExecuted input to a type of hidden. Add the following code to Button1_click. You will notice the onload will only fire on initial load of the page and not on back button.
protected void Button1_Click(object sender, EventArgs e)
Nov 09, 2009 06:01 PM|ankit_ddit|LINK
Thanxs for your reply. I have another question .I would be appreciate if you could help me.
Nov 10, 2009 01:29 PM|atifsarfraz|LINK
Here is an article that is doing something similar to what you are trying to do.
You might be able to achieve the same thing with an Iframe.
2- Have an IFrame where you want the Grid to appear.
3- Create a page with just your Grid in it e.g. MyGridPage.aspx.
4- From the window.onload method set your iframe and pass in the query string something like
MyIframe.src = "~/MyGridPage.aspx?P1=" + P1Value + "&P2=" + P2Value;
Hope this helps
Nov 10, 2009 01:57 PM|ankit_ddit|LINK
Thanxs for the reply. but i have different conditons to display gridview. i am generating gridview dynamic. its not static. whatever the columns and styles user has set in the db accorging to that i am making gridview.