|
hi,
i have a question that ,how we can track the client machine..like say example
i have a web application which my clients have access to it and i want to treck some how .. that user are active or not with his activity..
means here server can track their users every time ...
is it possible here in asp.net ...
and also can we treck that user where user had closed that web application or system crash.. so how can i know that this user are no longer active with this application.
Deepak Gedia
|
|
|
|
|
Deepak Gedia wrote: and also can we treck that user where user had closed that web application or system crash.
You need to use combination of session and application variables in Global.asax or in any HTTPModule . When user closes browser, no event will be fired on server. You can track session out from session_end event. This event will be fired when Session.Abandon() is called or when Session times out.
So keep an Application variable that holds Active users. When new sessions are created, Session_Start event will be fired. Inside this event you need to increase the application variable count. Application variable count should be decremented when session_end fires. To get active users print Application variable.
|
|
|
|
|
thnx for replying ... but what happens when the system crashes. at that time i dont think so the Session_End Event fires .... how can i treck that
see i am developing an time tracker application for the internal employees in asp.net
the thing is that the user logs in but some how if they close the window or application crashes or machine how i can set that users logout time .. thats the problem i am facing i even tryed out for the push architecture but .. didnt get the response much..
|
|
|
|
|
Deepak Gedia wrote: but what happens when the system crashes. at that time i dont think so the Session_End Event fires .... how can i treck that
Which system crashes ? Client machine or Server. If client machine crashes, immediately session_end won't be fired. It will be fired when session end for the user. By default it will be 20mins. After that it will fire session_end event. But if server machine is crashing, I am sorry not even session_end, nothing will be fired.
Deepak Gedia wrote: the thing is that the user logs in but some how if they close the window or application crashes or machine how i can set that users logout time
Same way what I told in the previous posts. To understand how session and it's event works, better take a good ASP.NET book and learn.
Happy Programming
|
|
|
|
|
How can i a store a data table value, that i required in more than one page and should be specific to user?.....
|
|
|
|
|
anujose wrote: How can i a store a data table value, that i required in more than one page and should be specific to user?.....
Store DataTable object in Session
|
|
|
|
|
Can you give me a example?is it same like i am storing in a cache variable ?
Like this
Cache["dt"]=dttable;
dttable=(datatable) Cache["dt"];
can i use ?
Session["dt"]=dttable;
dttable=(datatable) Session["dt"];
if it's possible is it good to store a datatable to a seesion Variable?
|
|
|
|
|
You can go with second method. Cache is not user specific. It will be common for all users accessing website. Session keeps datatable user specific.
anujose wrote: if it's possible is it good to store a datatable to a seesion Variable?
This depends on the size of your datatable. If it is pretty big, then this method might cause performance issues. If it is small object then I think there is no issues.
|
|
|
|
|
I want to create photo gallery by adding photos in gallery by just dragging the files from external folder. This I have to do in asp.net.
|
|
|
|
|
|
Hi everyone,
Please recommend good dropdown (or something like that) color picker for asp.net 2.0, I do not want Advanced one, just to click and than select a color prom spectrum or from list, also I do not wand just simple dropdown with color names.
Thanks lot
|
|
|
|
|
totocaster wrote: also I do not wand just simple dropdown with color names.
Then you have to write one custom control.
|
|
|
|
|
and there are no already written ones?
|
|
|
|
|
I didn't find anything
|
|
|
|
|
|
found one!
http://www.codeproject.com/aspnet/ColorPicker.asp
|
|
|
|
|
is there ay other way to execute the reports other then the crystal reports viewer way?
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Sonia Gupta wrote: other way
You mean rendering? You have builtin ways to export as PDF right? Acrobat Reader or FoxIT is quite common tool of every desktop.
|
|
|
|
|
if u please provide any link?
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
|
hello dude,
There is other way it is using a report viewer control.By that we can generate reports.Plz search and reply again i want the details about that control....i think we can generate report using SQL REPORTING SERVICES CONFIGURATION...
ok byeee
Murali
Murali
|
|
|
|
|
Hi Everyone,
I have 4 columns GridView.. One is BoundField This column is binded to Sno field from my Access Datasource.. 2nd, 3rd & 4th columns are TemplateFields (PartNo, Manufacturer, Qunatity) .. In this Template Fields, I have textboxes./.
Now, Below this Gridview i hv a Button (btnSubmit). What I am trying to do is when user enters values in to textboxes & click on Submit button, all the values should get update in the database..
To achieve this, i have written the following code:
<asp:GridView ID="myGridView1" runat="server" Width="483px" CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False" DataSourceID="AccessDataSource1" OnSelectedIndexChanged="myGridView1_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="Sno" HeaderText="SNo" SortExpression="Sno"/>
<asp:TemplateField HeaderText="PartNo">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtPartNo">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Manufacturer">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtMfg">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Quantity">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtQty">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/db1.mdb"
SelectCommand="SELECT [Sno] FROM [RfqInfo]" >
____________________________
protected void btnSubmit_Click(object sender, EventArgs e)
{
OleDbConnection myConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Documents and Settings\\venki\\My Documents\\Visual Studio 2005\\WebSites\\RFQTest\\App_Data\\db1.mdb");
myConnection.Open();
string strQuery = string.Empty;
foreach(GridViewRow dgRow in myGridView1.Rows)
{
string str = ((TextBox)dgRow.FindControl("txtPartNo")).Text.ToString();
string str1 = ((TextBox)dgRow.FindControl("txtMfg")).Text.ToString();
string str2 = ((TextBox)dgRow.FindControl("txtQty")).Text.ToString();
strQuery = "UPDATE [RfqInfo] SET [Partno]= '" + str + "', [mfg] = '" + str1 + "', [qty] = '" + str2 + "'";
}
OleDbCommand cmd = new OleDbCommand(strQuery, myConnection);
cmd.ExecuteNonQuery();
myConnection.Close();
}
now, my problem is when i'm clicking on submit its updating the database with the values of last row in my gridview... i'm really lost here.... Anyone please help me........ Is there any wrong with my code? I have searched throughout the google but couldn't fine one...
Any help would be appreciated........
Thanks in Advance.
|
|
|
|
|
Hi DKalepu,
I think ,
string str = ((TextBox)dgRow.FindControl("txtPartNo")).Text.ToString();
this line your code giving you problem as you finding control but grid view is having rows of controls so it take last value and gives u ..
try to get values for perticular row .
try this ,
myGridView1.Rows[dgRow.RowIndex].FindControl("txtPartNo")).Text.ToString();
i am not sure ..try some R&D on this u will find answer
pallavi
|
|
|
|
|
Hi Pallavi,
thanks for reply.... I have tried it by debugging. oh but still, same problem..
the value gets stored in the last row position only...
can u plz give me any other advices.....
Thanks,
Durga.
|
|
|
|
|
hello sir,
Instead of keeping in ItemTemplate keep in EditItemTemplate..
ok It will work and plz check datasourceID and dataconnection ..I think only one should be declared.
Try like this ..
ok byee
Murali
Murali
|
|
|
|