|
for knowing when things start the best approach then would be to possibly tie it into the Application_Start method in the Global.asax.
However knowing when they have left your sight will have to be tied into the page unLoad event. the problem with that approach is that leaving a page doesn't mean leaving the application, as you could just be leaving for another page in the application. this was why I tied into the page onLoad event but you are right there are other approaches. much like skinning a cat there is always more than one to do it.
Another approach maybe....
Tie into the Application_Start and then have an interval on your pages so that every so many seconds (configurable) a web method is called updating the fact that the user is still on your web page. Many moons ago in this very galazy I worked on a web based chat application that did something very similar.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
The Application_Start event would not be useful either. This event is fired when the application is started or the application pool is recycled. It has nothing to with individual sessions. The Page.Unload event is fired when the ASP.NET engine has completed processing, before the page has been rendered to the client and happens each time the page is processed, such as during a postback. I believe you should review the ASP.NET application and page life-cycles.
No comment
|
|
|
|
|
Mark Nischalke wrote: Page.Unload event
my mistake I was not clear, I was referring to the unload for javascript against the body of the page. When I read this last night I was scratching my head thinking what are you talking about Page.Unload??
when I woke up this morning and read it all again I was like Homer Simpson...
I believe from the Global functions you should be able to find when the session starts. As far as finding when the user leaves the site... Well I think there are many approaches to find this out, each of them with their own download.
If you are trying to get something as close as possible to the real event (the user is no longer at your site) then I imagine you are going to have to tie it all into some interval based javascript code that is calling a server function. For that matter though I wonder if you could also just lower your session timers on the web server and once again use one of the Global functions.
I am sure this would make a great article (one probably already exists) to write sometime.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
You could put code in the SessionStart event to record when the user comes to the site. Or in the Login process if you use that. Capturing when the use leaves the site is more difficult. There have been many discussions here about how to get information when a user leaves a site. You may want to try a little searching here. It does involve JavaScript to call a server method.
No comment
|
|
|
|
|
I am new to working with web forms in 2010. To to that fact, I am wondering if you could tell me what validation control I can use in asp.net for a dropdown list control? Also what code would you use? What event ties the dropdown list control to the validation control?
|
|
|
|
|
You could use a RangeValidator and set the Minimum and Maximum properties to values (numeric) based on your dropdownlist values. There is no code to invoke this, it will happen automatically when the page is submitted just like all ASP.NET validator controls.
No comment
|
|
|
|
|
I have a question about the statement, "There is no code to invoke this, it will happen automatically when the page is submitted just like all ASP.NET validator controls.". I am not certain what you are referring to. Are you referring to setting the auto postback value to true? Would this occur when the user the user clicks the next button?
To catch all the errors that are on a page would you use the summary validator control?
|
|
|
|
|
The statement refers to the validation control. There is no code necessary to invoke it. ASP.NET handles all of that in the background, you don't need to do anything to invoke the validation. You should read this ASP.NET Validation Controls[^]
No comment
|
|
|
|
|
hi friends
i am using visual studio 2008 i created a master page and many content pages
but i am not able to set the master page as my start up page.
if i want to run the project i have to select any of the aspx pages then that page gets executed so plz do help me in this issue
K.Gayathri
|
|
|
|
|
You can't set master page as start up page. You have to set any of content page as master page.
This content page first execute the master page part and then content page code.
|
|
|
|
|
MalarGayu wrote: but i am not able to set the master page as my start up page.
that is because a masterpage cannot be a default page, only content pages can fill this role. another to take into consideration is what your server will also server as the default start page. IIS for instance usually wants a page named index or default to be available.
if you don't create that default page that IIS wants then you are only going to have to deal with configuration matters down the road when you go to deploy the application.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
yes thanks for all your reply
got the logic of it..and understood
K.Gayathri
|
|
|
|
|
I have public class user where I have all my properties set for user (UserID,Name etc). Now I would like to create a new public class ListAllUser where I would add users with properties from user class.
how can I do this?
|
|
|
|
|
List<Users> users = new List<Users>();
Users user = new Users();
user.UserId = 1;
user.Name = "Byka";
users.Add( user );
You can do this in a for/foreach loop if you are reading the users from the database. if that's the case, you can go
List<Users> users = new List<Users>();
for(int i=0;i<length;i++)
{
Users user = new Users();
user.UserId = 1;
user.Name = "Byka";
users.Add( user );
}
Happy coding,
Morgs
|
|
|
|
|
excuse me but shouldn't this question really be asked in the language group for whatever language that you are developing with??
how do we know if you are using VB, c#, javascript, or c++??
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
Hi,
Border is not displaying properly in grid view.
|
|
|
|
|
See below.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
You have to understand how a gridview gets rendered for display on the clients browser.
without seeing the code for the page and whatever supporting code is going along with it we can't help. if the borders aren't showing it is definitely going to be a styling issue but where or when that is happening all depends on the styling of your page.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
DhivyaThangavel wrote: Border is not displaying properly in grid view. Did you set Borderstyle for the Gridview? Like below
<asp:GridView ID="GridView1" Runat="server" BorderWidth="1px" BorderStyle="Solid" BorderColor="#000000">
or
.GridStyle
{
border:1px solid #000000;
}
<asp:GridView ID="GridView1" Runat="server" CssClass="GridStyle">
or
<asp:GridView ID="GridView1" Runat="server" style="border:1px solid #000000;">
|
|
|
|
|
Hi,
Tab control is not showing while post back is occurred within update panel.
|
|
|
|
|
Do you have a question, and if so please provide some useful information about your code and what it is trying to do.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I placed a tab within update panel, when post back is occurred css is not applying. So tab is not showing properly.
|
|
|
|
|
Without seeing some code nobody can guess what is happening.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
<asp:panel id="pnlUserInputData" visible="true" runat="server">
<ajaxtoolkit:tabcontainer id="tbsUser" runat="server" activetabindex="0" width="850px"
="" cssclass="ajax__tab_xp" height="350px">
css file:
.ajax__tab_xp .ajax__tab_tab
{
height: 21px;
}
Aspx page is within masterpage in update panel.
|
|
|
|
|
DhivyaThangavel wrote: Tab control is not showing while post back is occurred
again really a factor of your CSS/styling and without all that information no one can help. however, if the problem is only occurring during a postback then my guess is your also have some javascript issues as well.
as mentioned by others though we really need to see a lot more than what you have offered.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|