|
Hi
You can user the Request.UrlReferrer property to check the page that refereed to the current page.
Using this property for the Referrer URL you can build your own Analytics
|
|
|
|
|
I have alredy use below line..
string MyReferrer = Request.UrlReferrer.ToString();
but when I try it to localhost, it jumps to catch block for error.. is it because i am trying it on my localhost??(becuse referrer url only exist on live server)
.
.
.
My means to say what will it reaturn if referrer URL is not found??
Thanks a lot.
modified on Thursday, September 3, 2009 2:44 AM
|
|
|
|
|
Value in Request.UrlReferrer.ToString will be null if the page is opened directly.
Try using the below example
Create Page Default2.aspx
protected void Page_Load(object sender, EventArgs e)
{
if (Request.UrlReferrer != null)
{
string strref = Request.UrlReferrer.ToString();
}
Response.Write("<a href='default3.aspx'>Link</a>");
}
Create Page Default3.aspx
protected void Page_Load(object sender, EventArgs e)
{
if (Request.UrlReferrer != null)
{
Response.Write(Request.UrlReferrer.ToString());
}
}
You will get the Value in the 'UrlReferrer' Property
|
|
|
|
|
Thanks for your help….
With this code I am able to track the URL of page from where we are coming but not able to track that URL which are transfer by server , there is some mechanism on server as client entered www.mysite.com/goto/aman they transfer it to my actual url, and I want to know that how many user hits are done by this one (www.mysite.com/goto/aman) where we have no control.
Thanks again for your kind help,
Abbas
|
|
|
|
|
You can get the URL of current page from Request.URL
Study the Request Object.
|
|
|
|
|
|
Hi guys my 5 user controls i have mentioned in my aspx page...,
in one of the user control i have used timer control with in updatepanel...,
in my timer tick event the control getting refresh...,its affection all other user controls methods to...,
i have given updatepanel updatemode as conditional...,then also its affecting other user control methods...,
how to solve it...,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
What is the scope of your timer, make sure its limited only for that specific page and not forcing a full page refresh.
|
|
|
|
|
when i run this code it show errors like "Type.'sysem.web.UI.Updaatepnael' doesnot have a public property named 'div','gridview'.......etc" plz chk code if there is any error
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<div id="divgrid" runat ="server" overflow:scroll style="position: absolute; width: 333px; height: 122px">
<asp:GridView ID="gvCouponDetails0" runat="server" AutoGenerateColumns="False"
CellPadding="4" ForeColor="#333333" GridLines="None"
onrowcancelingedit="gvCouponDetails_RowCancelingEdit"
onrowediting="gvCouponDetails_RowEditing"
onrowupdating="gvCouponDetails_RowUpdating"
style="top: 519px; left: 285px; position: absolute; height: 143px; width: 575px; z-index: 1; margin-left: 0px; margin-top: 0px;">
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#E3EAEB" />
<Columns>
<asp:CommandField ButtonType="Button" CancelText="C"
ControlStyle-Font-Size="10px" ControlStyle-ForeColor="Blue"
ControlStyle-Width="15px" EditText="E" ShowCancelButton="true"
ShowEditButton="true" UpdateText="U">
<ControlStyle Font-Size="10px" ForeColor="Blue" Width="15px" />
</asp:CommandField>
<asp:TemplateField HeaderText="Coupon Name">
<ItemTemplate>
<asp:Label ID="tbCouponName0" runat="server" Text='<%# Bind("CouponName") %>'
Width="100px" />
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ddlCoupon0" runat="server" DataSourceID="DSCouponType"
DataTextField="CouponName" DataValueField="Coupon_TypeID" Width="100px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Date">
<ItemTemplate>
<asp:Label ID="lblDate0" runat="server" Text='<%# Bind("Date") %>'
Width="65px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbDate0" runat="server" Text='<%# Bind("Date") %>'
Width="65px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Price">
<ItemTemplate>
<asp:Label ID="lblprice0" runat="server" Text='<%# Bind("Price") %>'
Width="50px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbprice0" runat="server" Text='<%# Bind("Price") %>'
Width="50px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="End">
<ItemTemplate>
<asp:Label ID="lblSerialEnd0" runat="server" Text='<%# Bind("SerialEnd") %>'
Width="50px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbSerialEnd0" runat="server" Text='<%# Bind("SerialEnd") %>'
Width="50px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Start">
<ItemTemplate>
<asp:Label ID="lblSerialStart0" runat="server"
Text='<%# Bind("SerialStart") %>' Width="50px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbSerialStart0" runat="server"
Text='<%# Bind("SerialStart") %>' Width="50px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Menu">
<ItemTemplate>
<asp:Label ID="tbMenu0" runat="server" Text='<%# Bind("CafeMenu") %>'
Width="80px" />
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ddlmenu0" runat="server" DataSourceID="DSMenu"
DataTextField="Cafe_Menu" DataValueField="Cafe_Menu" Width="80px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Description">
<ItemTemplate>
<asp:Label ID="lblDes0" runat="server" Text='<%# Bind("Description") %>'
Width="70px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbDes0" runat="server" Text='<%# Bind("Description") %>'
Width="70px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Transaction">
<ItemTemplate>
<asp:Label ID="lblTrans0" runat="server" Text='<%# Bind("Transaction") %>'
Width="70px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbTrans0" runat="server" Text='<%# Bind("Transaction") %>'
Width="70px" />
</EditItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#7C6F57" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</div>
</asp:UpdatePanel>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:Coupon ManagementConnectionString30 %>"
SelectCommand="SELECT * FROM [CouponTransaction]"></asp:SqlDataSource>
</asp:Content>
|
|
|
|
|
Enclose it in <ContentTemplate></ContentTemplate>
|
|
|
|
|
tHTS rIGHT wITH aRUN
uSE fOLLOWING cODE
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate >
<div id="divgrid" runat ="server" overflow:scroll style="position: absolute; width: 333px; height: 122px">
<asp:GridView ID="gvCouponDetails0" runat="server" AutoGenerateColumns="False"
CellPadding="4" ForeColor="#333333" GridLines="None"
onrowcancelingedit="gvCouponDetails_RowCancelingEdit"
onrowediting="gvCouponDetails_RowEditing"
onrowupdating="gvCouponDetails_RowUpdating"
style="top: 519px; left: 285px; position: absolute; height: 143px; width: 575px; z-index: 1; margin-left: 0px; margin-top: 0px;">
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#E3EAEB" />
<Columns>
<asp:CommandField ButtonType="Button" CancelText="C"
ControlStyle-Font-Size="10px" ControlStyle-ForeColor="Blue"
ControlStyle-Width="15px" EditText="E" ShowCancelButton="true"
ShowEditButton="true" UpdateText="U">
<ControlStyle Font-Size="10px" ForeColor="Blue" Width="15px" />
</asp:CommandField>
<asp:TemplateField HeaderText="Coupon Name">
<ItemTemplate>
<asp:Label ID="tbCouponName0" runat="server" Text='<%# Bind("CouponName") %>'
Width="100px" />
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ddlCoupon0" runat="server" DataSourceID="DSCouponType"
DataTextField="CouponName" DataValueField="Coupon_TypeID" Width="100px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Date">
<ItemTemplate>
<asp:Label ID="lblDate0" runat="server" Text='<%# Bind("Date") %>'
Width="65px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbDate0" runat="server" Text='<%# Bind("Date") %>'
Width="65px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Price">
<ItemTemplate>
<asp:Label ID="lblprice0" runat="server" Text='<%# Bind("Price") %>'
Width="50px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbprice0" runat="server" Text='<%# Bind("Price") %>'
Width="50px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="End">
<ItemTemplate>
<asp:Label ID="lblSerialEnd0" runat="server" Text='<%# Bind("SerialEnd") %>'
Width="50px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbSerialEnd0" runat="server" Text='<%# Bind("SerialEnd") %>'
Width="50px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Start">
<ItemTemplate>
<asp:Label ID="lblSerialStart0" runat="server"
Text='<%# Bind("SerialStart") %>' Width="50px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbSerialStart0" runat="server"
Text='<%# Bind("SerialStart") %>' Width="50px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Menu">
<ItemTemplate>
<asp:Label ID="tbMenu0" runat="server" Text='<%# Bind("CafeMenu") %>'
Width="80px" />
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ddlmenu0" runat="server" DataSourceID="DSMenu"
DataTextField="Cafe_Menu" DataValueField="Cafe_Menu" Width="80px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Description">
<ItemTemplate>
<asp:Label ID="lblDes0" runat="server" Text='<%# Bind("Description") %>'
Width="70px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbDes0" runat="server" Text='<%# Bind("Description") %>'
Width="70px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Transaction">
<ItemTemplate>
<asp:Label ID="lblTrans0" runat="server" Text='<%# Bind("Transaction") %>'
Width="70px" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="tbTrans0" runat="server" Text='<%# Bind("Transaction") %>'
Width="70px" />
</EditItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#7C6F57" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:Coupon ManagementConnectionString30 %>"
SelectCommand="SELECT * FROM [CouponTransaction]"></asp:SqlDataSource>
</asp:Content>
|
|
|
|
|
there is no error the code u suggest but on run it not show gridview.
|
|
|
|
|
|
You code is missing <ContentTemplate> construct. Wrap every thing within your update panel in <ContentTemplate> . For example net out put should be something like
<updatepanel ------ ><br />
<ContentTemplate><br />
.................<br />
</ContentTemplate><br />
</updatepanel>
|
|
|
|
|
Hi all,
i have a issue.
i need to display alert Message before the page is redirect to another page.
1)alert Message
2)Response.Redirect("test.aspx")
Here, i have to use Response.Redirect complusory.
Please Help Me.
Thanks in Advance.
JohnDas
|
|
|
|
|
|
Alert is a client side operatoiin where as Response.Redirect is server side. You can't do both at same time because in your case you first need alert and then redirect. Soluton would be to out put some javascript that in turn do the desired task for you. For example try something like below in your ASP.NET code where you want this behaviour.
<codepage.registerclientscriptblock("alert-script", "alert('your="" alert="" here');window.location="http://yourdomain.xyz" ;");="">
|
|
|
|
|
can any one confirm that i want to implement passport based authentication in asp.net
and latest sdk found on microsoft website is 1 year old and only works for iis6
i am using iis7 is that obsolete or any other alternative way to implement this...
any help would be appriciated...
Government Dyal Singh College Lahore.
|
|
|
|
|
|
thanks for reply
yes i have seen these both articles already
first post is 6 years old and second one is related to iis 6 i want to implement it on iis7
or do you have any latest article related to this.. i have found SDK which is also 2,3 years old...
Government Dyal Singh College Lahore.
|
|
|
|
|
|
thanks this is what i was looking for..
Government Dyal Singh College Lahore.
|
|
|
|
|
what is Ajax?I want to use the technology in image control
|
|
|
|
|
ritasaumya wrote: what is Ajax?
It is Asynchronous JavaScript and XML.
ritasaumya wrote: I want to use the technology in image control
You need to clarify what you meant here.
|
|
|
|
|
Why do you want to use it, if you have no idea what it is ? Did you read the term on the internet and decide it would make you cooler ?
Don't use things you don't understand, and don't use things for the sake of them.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|