|
AjAX Toolkit[^]
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
Timer controls work well on an asp.net page. As a web page refreshes each time it is back, You should declare the time control as a static attribute of the page, as well as the timer event handler.
protected System.Timers.Timer timer1; <br />
private int test; <br />
<br />
protected void Page_Load(object sender, System.EventArgs e) <br />
{ <br />
test = 1; <br />
<br />
timer1.Interval = 1000; <br />
timer1.Start(); <br />
<br />
timer1.Enabled = true; <br />
<br />
} <br />
<br />
<br />
<br />
private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e) <br />
{ <br />
<br />
test = test+1; <br />
<br />
lblCounter.Text = "count:"+test; <br />
<br />
} <br />
<br />
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Vri SSK wrote: Timer controls work well on an asp.net page.
No, they really don't. In your example every user will have the same timer
A javascript timer will work, such as the one within the AJAX Toolkit.
Please consider your answer to questions before posting them, if you're unsure its probably better to not bother posting.
|
|
|
|
|
J4amieC wrote: f you're unsure its probably better to not bother posting
I'm never 100% sure..
..even an answer that isn't 100% can give you a pointer in the right direction. Sometimes such an answer becomes the base for an entire discussion. It does happen that we generate an adequate answer as a group, because we interact.
FWIW; you can make the code user-specific
|
|
|
|
|
eddyvluggen wrote: ..even an answer that isn't 100% can give you a pointer in the right direction.
And a stupid answer like the one given can lead you down the garden path, round the block and back again. In addition, im 99% sure the OP wanted a timer on the client not the server. He may not have specified that, but after years of answering questions on forums like CP, you can generally tell.
eddyvluggen wrote: FWIW; you can make the code user-specific
Not with a static Timer you cant. You may wish to read up on the static keyword.
|
|
|
|
|
J4amieC wrote: You may wish to read up on the static keyword.
Will do. I assumed that the component is simply shared among the users. Am I mistaken?
J4amieC wrote: And a stupid answer like the one given can lead you down the garden path, round the block and back again.
Thanks for the warning
|
|
|
|
|
One problem I found on the timer control is that if I had code running on page load and the timer was set to update say eevry minute the code on the page load would run as well.
This is a big drawback if you are using postback scripts etc
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
how to filtered textbox
i want to put only valid char suppose (a-z,0-9)
please just send me the solution.
|
|
|
|
|
Try using a regex validator to check chars.
|
|
|
|
|
Hello,
U can assign a regularexpression validator to the text box.
regularexpression can be "^[a-zA-Z0-9]$"
try this.
|
|
|
|
|
Hello, You can check on client side also.
using textchanged event of that textbox.
call a function on textchange and on the function check the keychar
if it is within your range then text will be added otherwise it return false, means character not appended on that textbox. Only valid char will appears.
Try to make a javascript function..
Best of luck.
Dipak
|
|
|
|
|
Just check this link...
I am saying this type of code..
http://www.w3schools.com/jsref/jsref_onkeydown.asp
Try it out.
Dipak
|
|
|
|
|
Hi Friends
I have developed a ModelPopExteder with CheckBoxes.My Problem is how to know the which check box is checked.
your's subbu
|
|
|
|
|
Hi all,
I have a requirement of exporting webpage as image into MS Word, PDF and Power Point.
I succeeded converting the Web Page into Image by using the WebBrowser control.
But i have to export these image to MS Word, PDF and Power Point.
Please suggest me, how to do that.
Thanks in advance,
Cheers'
sekhar
|
|
|
|
|
how can add a user control dynamically more than one time and
how can store the values into a database
pls help me
|
|
|
|
|
r u a programmer or trainee.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
hi!
My problem is:
I HAVE A 3 COLUMNS(ID,NAME&CITY) IN TABLE T1.
IN MY TABLE MY (ID) COLUMN HAS NO VALUE. BUT OTHER TWO COLUMN HAS ITS OWN SAME VALUE.
eg: OUR (NAME) COLUMN HAS ONLY CONTAIN "VICKY" IN WHOLE COLUMN. AND
(CITY) COLUMN HAS ONLY CONTAIN "DELHI" IN WHOLE COLUMN.
MY REQUIREMENT IS THAT, I WANT TO INSERT THE VALUE IN ID COLUMN AS 1,2,3 AND SO ON.
PLEASE SOLVE MY PROBLEM
THANKS
|
|
|
|
|
if you're using SQL Server, declare the ID column as an Identity column. google this out yourself. You need to specify it as an identity field with a seed and increment value and SQL Server will handle the rest itself.
Hope it solves ur problem
|
|
|
|
|
hi sir!
Sir I don't know what is the procedure to add the identity in my table. beacuse my table has been already created.
please help me.
bye
|
|
|
|
|
|
a/c to your advice i did. but folloeing errors occured. because in id column contain null value
------
'T1' table
- Unable to modify table.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'ID', table 'Zaid.dbo.Tmp_T1'; column does not allow nulls. INSERT fails.
[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.
-------
|
|
|
|
|
how many records do u have in that table already?
Can u afford to delete that table and create it again?
|
|
|
|
|
sorry sir, I can't delete because that is the problem.
|
|
|
|
|
yes I think Bob got to the root of that problem, I really think you'd read some manuals atleast to get to grips with this. try removing the ID column from the insert statement
|
|
|
|
|
Thts because you need to omit identity columns from your insert.
It seems you have very little understanding of sql, I suggest you read up on it before going much further.
Bob
Ashfield Consultants Ltd
|
|
|
|