|
Hello,
Use a timer!
Like System.Windows.Forms.Timer with the "tick" event.
Make sure that this timer class fitts your needs, as there are many more available.
Abubakarsb wrote: Please remember I don't want to refresh page every time.
What is the connection to the timer question?
All the best,
Martin
|
|
|
|
|
I want to use it in asp.net, I mean for web project not for desktop.
|
|
|
|
|
c# will be running on the server, not the client.
You'll need some kind of client side javascript timer
Russell
|
|
|
|
|
So can anyone of you send me code in javascript in which i can fire an event defined in C# after a certain amount of time after page has been loaded?
|
|
|
|
|
<script language="Javascript">
<!--
var lengthOfTime
var id = null
var running = false
function Setup()
{
lengthOfTime = 5
Stop()
}
function Stop()
{
if (running)
clearTimeout(id)
running = false
}
function Start()
{
if (lengthOfTime == 0)
{
Stop()
}
else
{
--lengthOfTime
running = true
id = self.setTimeout("Start()", 1000)
}
}
</script>
All you need to do then, is to put the following in your code <body on Load="Setup()"> and trigger your item by calling the Start() function. Note that you will probably want to use a mechanism such as Ajax to actually trigger the C#.
(BTW remove the space between on and Load.)
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi
Could anyone tell me how to get a default value for a combo box in C#.
Keshav Kamat
India.
|
|
|
|
|
In Page Load event put.
<br />
PubicMyString = textbox1.Text<br />
You will find in the InitializeComponent() event the value is set by code as shown below.
private void InitializeComponent()<br />
{<br />
.<br />
.<br />
.<br />
<br />
this.textBox1.Text = "ThisISDefaultText";<br />
<br />
.<br />
.<br />
.<br />
}
Grady Booch: I told Google to their face...what you need is some serious adult supervision. (2007 Turing lecture)
http:\\www.frankkerrigan.com
|
|
|
|
|
Hey thanks Frank.
Got it. I knew a long procedure, to have a default value. This thing is the most efficient one that I found till date for the purpose.
Thanks once again.
Keshav Kamat
India
|
|
|
|
|
Hi,
I have a weird problem. You can color a button by button.BackColor = ....;
In the design window I see the colored button, but when I will simulate the program, the buttons are just gray (default). Is it cause of WindowsCE?
I can color the form or change the font of the text in a button, but I can't color a button.
Thanks in advance
|
|
|
|
|
check the appearance property of button it might be set on System
|
|
|
|
|
At the properties window, I don't see something is set on System. The following things are there:
-Appearance
+Font
Text
-Behavior
...
...
...
but nothing else what is set on System
|
|
|
|
|
Hi guys,
I needs some help with this challenge I'm facing please.
This is my challenge:
I have a string with "parent object" and item in the format of pipe delimited between "parent objects" and comma delimited between items. Like this
string sample = "Object1,Item1,Item2-Object2,Item1,Item2-Object3,Item1,Item2";
How will I go about manipulating the string to use the "objects" and items in this format.
I basically need to get the "object" and the items and in some cases I will need to work with one entire entry at a time, lets say Object1,Item1,Item2 .
I am not to familiar with the System.String functions yet and would love if anybody around here could show me how this could be done or possibly some references.
Thanks.
R
|
|
|
|
|
Hi
I have added comments for each line. Hope it helps you.
string StrObjectItems = "";
StrObjectItems = "Object1,Item1,Item2-Object2,Item1,Item2-Object3,Item1,Item2";
string[] StrObjectsArray = StrObjectItems.Split(new char[] { '-' });
for (int i = 0; i <= StrObjectsArray.GetUpperBound(0); i++)
{
string StrObjects = StrObjectsArray[i].ToString();
string[] StrItemsArray = StrObjects.Split(new char[] { ',' });
for (int j = 0; j <= StrItemsArray.GetUpperBound(0); j++)
{
string StrItems = StrItemsArray[j].ToString();
}
}
-- modified at 5:23 Tuesday 6th March, 2007
Rate this message. Thank you. Harini
|
|
|
|
|
I don't see any pipe (|) characters in the string. I suppose that you mean that the parent strings are delimited by a dash (-).
To get the parent string in an array, split on a dash:
string[] parents = sample.Split('-');
The property parents.Length will give you the number of strings.
To get the child strings of a parent, split it on a comma:
string[] children = parents[0].Split(',');
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks to both of you that replied.
It all makes sense now.
Thank you once again!
R
|
|
|
|
|
Hi.
the following line looks for the character '-' in the string.
the flag checks whether it is true or not.
then it checks where the character is found, and the substrings are taken into other strings.
bool flag=false;
flag=sample.Contains("-");
if(flag==true)
{
int m=sample.IndexOf("-");
string s1 = sample.Substring(0, m); // s1 will contain Object1,Item1,Item2
sample = sample.Remove(0, m+1); // now the sample will contain
//Object2,Item1,Item2-Object3,Item1,Item2
}
Hence you can repeat the procedure to store the other substrings, maybe in a string arraylist.
i hope this helps.
keshav kamat
siemens india
|
|
|
|
|
Alternatively,
one can use the Split funtion depending upon a special character.
string[] string1=sample.Split("-");
the number of members are identified by the string1.Length property, which will give you the count of the members in the new string after the split.
Keshav Kamat
India.
|
|
|
|
|
Hi all !
Tell me please if anybody use Add-in technology for Ribbon in MS Word 2007
How I can create a new button in ribbon using Add-in in document-level (not in application level).
|
|
|
|
|
I'm trying to connect to an access DB remotely. I'm using a web server to access this DB. Is it possible to connect to an access DB in this way??
Or I must use someting else like SQL server for doing that?
|
|
|
|
|
You need write permission on the webserver, which leaves you with a pretty unsafe situation. I'd recommend something like SQL Server or creating a webservice which manipulates your acces database server side...
|
|
|
|
|
i am using a web service which manage this connection string:
EncoderData.DataManager.Constants.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=\\\\" + host + "\\data\\BroadcastingData.mdb";
where "host" is the computer name of the remote server.
is that a right connection string ??
thanks in advance !
|
|
|
|
|
That is i have set access rights for windows login users but i need do to the code for login windows users please send me some idea about this concept if u have send me the code
|
|
|
|
|
|
This doesn't make any sense at all. We have no idea what you're trying to do.
wrote: i need do to the code for login windows users
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
dears i want to create setup project that would make a setup file to be installed on windows system. so i created the project by reading the help but it finally did not work. it creates a .msm file .how can i get setup file that should run by double click. and do the task which is assigned to it...
thanks in advance
|
|
|
|