|
yibiBrown wrote: I would like to perform some action when the application has gone idle
Please define what you mean by a "Web Application gone idle". Idle is not a common term used in technical discussions of web applications. By not common I mean I have never heard anyone use it before.
led mike
|
|
|
|
|
What I mean by the application going idle is that the user has stopped working with it. Either the mouse hasn't moved or the keyboard pressed in a given amount of time.
Yibi
|
|
|
|
|
In case you are interested I had no idea how do this. I found all the information using Google.
function initializePage()
{
document.onkeydown = function()
{ SetupTimer(); }
document.onmousemove = function()
{ SetupTimer(); }
SetupTimer();
}
var activityTimer = null;
function SetupTimer()
{
if(null != activityTimer) clearTimeout(activityTimer);
activityTimer = setTimeout("alert('Timed out')", 5000);
}
led mike
|
|
|
|
|
do u mean session of the web application?
Amit Agarwal
|
|
|
|
|
Can anyone help know how to implement transaction in asp .net? Just like the database transaction, can we put some lines of code in a transaction ...for example
begin transaction
{
myMethodToSendMail() //sends email
myMethodToWrite() //Writes into an file e.g. xml file
myMethodToDB() //updates database
}
commit
Is there any way to achieve the above situation via asp .net using c#? I dont think the class SqlTransaction is the one to use......can anyone help...thanks in advance
|
|
|
|
|
om pr wrote: Can anyone help know how to implement transaction in asp .net?
No. No one knows how to do that. And if someone did know it certainly would not be Microsoft and they certainly would NOT document it[^].
Good luck, you're going to need it.
led mike
|
|
|
|
|
I am not sure that there is support for such a thing, except that you can send the mail last, and then undo the other steps, if one fails.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
First, a definition of context. I'm working with user controls, which utilize the .ascx markup with the codebehind pointing to the .cs, basically the same model as a page. This is not the same as custom server controls, which are precompiled and generate the html output by hand. I have a significant number of user controls which display grids and other non trivial forms of output.
What I'm looking to do is build snippets of script code that people can copy & paste into their own web site, thus displaying the data that I feed them through the script. An example of this might be:
<script src="http://www.website.com/ShowList.aspx"></script>
the result of which would be displaying the grid view on the site who pasted this script into their page. This is a fairly common technique for javascript output. If I wanted to print "Hello, World!" on your web page, in the Page_Load of ShowList.aspx I could do something like this:
<br />
Response.Write("document.write('Hello World!');");<br />
By pasting the above script onto your page, Hello, World! magically appears. So far, so good. If I wanted to output something more complex, like a table, I could update the output to instead call document.getElementById() of some predefined div and then set the element's innerHTML to the HTML of the table, etc. Then the table would appear on your page, as if by magic. Again, no problem to do.
Now we get to the fun part. I don't want to reinvent the wheel and code the logic of dozens of controls all over again, using this model, so that I can use them as output in the aforementioned scripting scenario. What I really want to do is effectively hook into the output of the user control and redirect that output for use by the script. Here's a pseudo code idea of what I mean:
- Page_Load of ShowList.aspx spits out opening javascript, i.e. document.getElementById() our div
- UserControlOne.ascx outputs a grid control, we redirect the final html output of this grid to a routine in ShowList
- This routine takes the html and assigns it to the innerHTML of the element we found in step 1
- We now bask in the glory of our grid being automagically output to the user of the one line of script code
As you can see, where the rubber meets the road is hooking the html output of our user control so that we can redirect it to the output stream being formatted as javascript, and that's the part I'm having difficulty with. In the old C++ / MFC days, it was an ongoing business of finding out where you needed to hook something, hacking your way into it and redirecting it to where you wanted it to go. The fact that you had the full MFC code that you could step through in your debugger helped immensely, of course.
Unfortunatly, my knowledge of the ASP.NET architecture isn't yet that deep, and so I'm struggling trying to figure out how to hook the output of a user control and point it where I want it to go, i.e. the example above.
Apologies for the long explanation, but I asked this question last week and got little response because I really didn't ask the question very well. Hopefully this will give the knowledgable among you sufficient information about what I'm trying to accomplish that you can point me in the right direction.
And of course, any help would be most gratefully accepted!
|
|
|
|
|
Good Afternoon All
Am new to ASP.NET 2.0 or any other ASP.NET versions, i have a Book and am working on it. Please dont eat me for the following Basic Question. i have a Blank Pade, it has appeared as Default.ASPX, so i have Added a Pic in the PAge and wrote some text that says UnderConstructions. So when i run this Pic it does not Show, i have added a Calender server control and it does not show when the page is loaded.This mage i have added, i have done it using the image server control. and it does not show.
1)what should i keep in mind about server controls when i add them to my page?
2)What is the Difference betwwen them and other Controls(Still comming Chapter in my Book)
please give me more Advice
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
add runat="server" to your components
|
|
|
|
|
Hi man Thanks for your reply,
I thought VS do it for you, i have checked the Sorce that VS generate when dropping the control into the form and it look like this
<asp:Calendar ID="Calendar1" runat="server" BackColor="#FFFFCC" BorderColor="#FFCC66"
BorderWidth="1px" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="#663399" Height="200px" ShowGridLines="True" Width="220px" OnSelectionChanged="Calendar1_SelectionChanged" VisibleDate="2008-04-16">
<SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
<TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
<SelectorStyle BackColor="#FFCC66" />
<OtherMonthDayStyle ForeColor="#CC9966" />
<NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
<DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
<TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt" ForeColor="#FFFFCC" />
</asp:Calendar>
</p>
And it the like is there, but still it does not do anything
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
can you show the ASPX-code form the asp:Image-component?
|
|
|
|
|
no i cant, in the Flowing page, as i said , there is Calender Control, a Photo and some text that says Under Construction. here is the Page address.
http://www.tiyaneproperties.co.za/index.aspx[^]
thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
the url of your image is
http://www.tiyaneproperties.co.za/httpdocs/images/tiyane2.jpg[^]
It results in a 404. So the image is not there on your webserver. That is why it is not showing.
your page code is:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="httpdocs_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<br />
<asp:Image ID="Image1" runat="server" Height="184px" ImageUrl="~/httpdocs/images/tiyane2.jpg"
Width="520px" /><br />
<br />
<span style="font-size: 24pt; font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman';
mso-ansi-language: EN-GB; mso-fareast-language: EN-GB; mso-bidi-language: AR-SA">
<strong>
Under Construction</strong></span></div>
</form>
</body>
</html>
It does not say anything about your Calendar Control.
Have you published your latest codings on the webserver?
|
|
|
|
|
Thansk man for your Patience
let me explain this Situation. Am using a Domain bought from www.webonline.biz, it look that they use Apache webserver for hosting the Domains(Am not sure), but i have another Example pages that am doing and Pics come out. check this one http://www.tiyaneproperties.co.za/Wrox%20United/History.aspx[^]
And the pic is well displayed, but the pic am trying to Display in the other site, its not displaying, the Pic is available in the image Folder, its not like am coding it my self, i just Browse to it in the Property wondows of VS. so am not sure what wrong there
thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Well,
if (image in the folder && image is located via VS)
Are there any blocking rights on the folder of the webserver?
|
|
|
|
|
hi
My Permissions are Fine, Do you think my web server does not support ASP.NET 2.0, if my service provider is using Apache, am not sure but i see this www.tiyaneproperties.co.za. i Supposed that might be the Problem, if its like this , will i get a chagen to develop for ASP.NET 2.0?
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
2 - a server control emits HTML based on code that runs on the server. Normal HTML controls are spit out verbatim. If you add any attributes to a server control that the server does not recognise, it passes them through verbatim to the client, no other code you enter on a server control makes it to the client, it just tells the framework what code to generate.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
what namespace is used for get server date and time
|
|
|
|
|
FOR GOD SAKE STOP USING QUESTION AS YOUR BLOODY THREAD TITLE, THEY ARE ALL QUESTIONS!!
|
|
|
|
|
J4amieC wrote: THEY ARE ALL QUESTIONS!!
I'm pretty sure I have seen a few that were not.
led mike
|
|
|
|
|
Its System.DateTime.Now
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
System.DateTime
Ashish Sehajpal
|
|
|
|
|
using System;
Console.WriteLine(DateTime.Now.ToString());
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|