I have a aspx page for booking tickets, and i am providing link to users through mail(link of booking page) .
when they click that link it should check the time 09:00 AM then it should navigate to booking page else redirect to another page showing message "not allowed this time"
if (DateTime.Now.Hour == 9)
Response.Redirect("Page.aspx");
else
Response.Write("<script language='javascript'>alert('Not allowed this time');</script>");
You are checking for a Current time of the Server using DateTime.Now.Hour. It takes current time from a server, and taking only HOUR part of this datetime. If your hour is 9 o'clock (it don't consider minutes), user will be redirected to the some Page.aspx. You have to change the name.
If it is not 9 o'clock, corresponding alert will be displayed.
Related
How is Time on Page calculated by GA?
Referring to the first search result link that appeared - https://help.analyticsedge.com/article/misunderstood-metrics-time-on-page-session-duration/
If Visitor 1 visited page1 at 0:00 and moved to page2 at 0:45, then
time on page for page1 = 0:45-0:00 = 0:45
time on page for page2 = ???-0.45 = 0:00
Session duration = 0:45
If this was true then if a user spent 10 mins on a single page where he just read content but never went to other page then will the time on page and session duration be 0:00?
Yes, it can only track time against another action. In most cases this means non-bounce and non-exit pages only have a time on page stat. There are other ways to get timer stats. If you use Google Tag Manager you can use a timer trigger to fire at intervals, so it will fire, for example, every 10 seconds that someone is on the page, and not fire when they've left the page.
I'm trying to solve an issue where a database column is getting set when navigating to a page in an ASP.NET site. This is a quote management web application, and when opening a quote and navigating to a certain page, the "Expiration Date" is automatically updated to the current date. I have verified that this is occurring prior to triggering the Page_Load function in the ascx.cs file. I have tried to trace what is being run prior to this, but I'm afraid my knowledge of ASP.NET is insufficient, and I don't know exactly where to look. From the pieces I can tell are run prior (for example, the aspx.cs file), I see nothing to indicate any alterations to the record.
When I dig deeper, it seems almost as if the change is taking pace upon leaving the main landing page when editing a quote. If I update the value and travel to any page for the quote except for the main page, it stays the same. And I can travel to the main page, check the record in the database, it stays the same. But it seems like as soon as I navigate from that main page, the Expiration Date will change to the current date. Is there somewhere I can check to see if that's what's happening?
-- EDIT --
Maybe a detail list of actions might help...
View list of quotes in system
Click "Edit" link for quote
View "Quote Details" page, which is first page upon edit access
Look at database query for quote to see exp date is still proper
value
Click "Quote Options" navigation link
See expiration date in "Quote Options" has now changed to current
date
Check database query to see that without performing a known save to
the database the exp date value has updated in the database
Perform update to quote to reset exp date
View any other page in quote edit, return to "Options", see exp
date has not changed again from reset value
Verify proper date with database query
Revisit "Details" page
Again verify correct date with database query
Travel to any other page and then to "Options", or go straight
to "Options", see that exp date has changed to current date
This is the HTML on the link used, which appears to be identical on the other pages...
<a class="tabOff" id="ContentPlaceHolder1_linkButtonAddEditShipping" href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ctl00$ContentPlaceHolder1$linkButtonAddEditShipping", "", true, "", "", false, true))'>Quote Options</a>
I solved the problem. Sort of. I did discover that the save function was being triggered when leaving the "Details" page, even though no save action was being explicitly activated. The problem was resolved by getting the expiration date from the database at the beginning of the function, and if one was set, pushing that value back in at the very end of the function. While this has in effect prevented the value from being "overwritten", I am still unable to determine why the save function was being triggered, and unable to determine what actions within that function are setting the value to be the current date
I have implemented the following process to track User ID on my website:
If the user is not yet logged in, track a pageview
Once he registers or logs in, set user id and keep setting it on every page
I have session unification turned on.
It works OK except that in the "user id" view, I see 100% of acquisition surce/medium as (direct) / (none), but in "all data" though, the utm_ parameters for the same session have been tracked correctly.
I would like to see which campaign was each given user acquired by, but because of this, I am not seeing that.
What am I doing wrong?
Ok, I found the answer in the docs eventually:
Session unification is completed during daily data processing. Processing begins at 5am each day, based on the western most timezone selected in any reporting view that is associated with the property.
Looks like I have everything set up right, just need to wait for the recalculation.
Is there an ASP.NET Script to allow a specific webpage to be access only in a specific time of the day in the week? for example: in a course you want your students to access your webpage in your network in a certain hour of the day and the week!
Update:Answer cannot be no.i have an example from a site:www.codeforces.com
In this site in specific time,contest is running and codeforces allows a page on that time.
On your page_load you could have something like this
if (!IsAllowedTime())
{
Response.Redirect("/ComeBackLater.aspx");
}
Where within IsAllowedTime you would validate DateTime.Now against your time restrictions
When I am in the month view of FullCalendar, then say I go back a few months to March and click on an event, then hit the browser 'back' button, how can I make it so that the browser knows to go back to March? Currently, it just goes back to the current month.
Thanks
Here is one possible solution:
From eventClick callback, when you redirect the user to the other page. Also send current day, month and year of the calendar in the URL.
On that page get the values from URL and store them in session variables.
This is how you can get current date of the fullCalendar:
var calCurrDate = $('#calendar').fullCalendar('getView').start;
var date = calCurrDate.getDate();
var month = calCurrDate.getMonth();
var year = calCurrDate.getFullYear();
Now on calendar page check if those session variables are defined. If they are defined, add the following properties to fullCalendar
<cfif isDefined('SESSION.d')>
<cfoutput>
date: #SESSION.d#,
month: #SESSION.m#,
year: #SESSION.y#,
</cfoutput>
</cfif>
For server side language I've used Coldfusion (as I know only this). You can easily understand the logic and translate it to your desired language.
Note: At the end of the calendar page you must destroy the session variables. Otherwise every time when you refresh the page you'll be taken to the same day, month and year.
I hope this helps. Thanks