Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys,

i was working on asp.net pages using c#.

I want to find current active asp.net page.,

i.e; if the current active page is my asp_app ... then it should refresh my page.
like: if my app page is current active page.. then it should refresh...

Or any other solutions/suggestion, plzzz... help me.

Thanks
Posted
Updated 15-Mar-14 20:27pm
v2
Comments
OriginalGriff 15-Mar-14 3:59am    
Sorry, but that doesn't make a lot of sense.
You are talking about ASP.NET and Pages, which is fine, and WinForms and Apps, which are a totally different thing. The two do not generally interact.

Please, try to explain in better detail exactly what you are trying to do, (and if you can use the right terminology, that would probably help) and we'll see whet we can do.

Use the "Improve question" widget to edit your question and provide better information.
abdul subhan mohammed 16-Mar-14 2:25am    
Hi OriginalGriff thnx for responding,
actually i m talking about the asp.net pages only.
i want to run some code when the asp.net is active...
so plz help,if possible.

thnx 1s again.

There is no such thing as "Active" in ASP.Net pages because the web is a disconnected medium. That means that when someone visits your site all of your C# code runs, including the Page_Load event and then html is sent back to the client's browser. If there is any JavaScript included you can have it run. But at that point the machines are disconnected and there is no "Active" status.

If you want code to run when the page loads you can use the Page_Load event in C#.

If you want code to keep on running on the clientside you would use JavaScript and the window.setTimeout method which allows you to run a function ever x number of milliseconds. If they close the window or navigate somewhere else then your code is gone so it may just be that you need the setTimeout method.
 
Share this answer
 
You can use javascript to detect mouse move and key stroke event on current page.
If mouse move or key stroke existed on current page, you can consider it as "Active".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900