I've done it! Thanks a lot for your time and help!
Munteanu Ciprian
Posts
-
update global.asax variable from javascript -
update global.asax variable from javascriptAnd how do I add the script reference and where should I put the file?
-
update global.asax variable from javascriptAre you sure this is the correct way to call the page in javascript: "$.get('my_page.aspx');"? I've tried and it's not working...
-
update global.asax variable from javascriptCan you give me an example please? (with some code)
-
update global.asax variable from javascriptHi! I have a global variable which is initialized in Global.asax (in the Session_start event). Now I want using Javascript to update this variable and I don't know how to do that. Why I have to do that? Because I used javascript to create a small timer which, at every 10 minutes I want to increase the variable by 1. Can anyone help me please?
-
to Dinesh ManiThanks for your reply. I have one more question...You said to me that I should initialize a variable to 10 on session start. In what page's code should I do this? This is actually my problem: I don't know where to declare the variable which will hold the value of the label. I've tried in the page_load event of the master page but I'm sure this isn't right. Can you help me please?
-
Updating variables in Master PageThanks a lot! But how to do that:"on session start initialize it to 10". In what page's code should I do this?
-
Updating variables in Master PageHi everybody! I really need help... I have a Master Page with a menu and 2 Web Content Forms(called FirstWCF and SecondWCF). The menu contains two buttons used for Posting Back the two Web Content Forms. Now on my Master Page I have a label called Label1( Label1.Text="10") On FirstWCF I have a button and when I press it I want the Label1 to display 9, then 8 and so on until it displays 0. I've done this thing so far. The code is the next one:
protected void Button1_Click(object sender, EventArgs e)
{
Label lbl=(Label)Master.FindControl("Label1");
int tries=Convert.ToInt32(lbl.Text);
if (tries>0)
tries--;
lbl.Text=tries.ToString();
}This works just fine. When I'm on the FirstWCF and I press the button the label's text from the Master Page updates. But I got the next problem. When I load the SecondWCF I want the label's text to remain the same. Instead it has again the value "10". To be more clearly, I'm on the first page, I pressed 3 times the button (the label has the value 7), and then I press the menu item which loads the SecondWCF. The label's text becomes again 10 and I want to remain 7. Can anyone help me? I really need help....
-
ThreadHi! Here what I want to do: I have a label and in it I want to display the seconds beginning from 60 and finishing with 0 at the interval of one second, and then again and again (basically a little stop watch). I've tried something using C# and a delegate, but I can't use the method Invoke which I was using in C#. Here the of what I've done:
public delegate void del_time();
public Thread threadTime;
public int time = 60;
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
labelTime.Text = "TIME 60";
threadTime = new Thread(new ThreadStart(Display_Time));
threadTime.IsBackground = true;
threadTime.Start();
}
}protected void Dsiplay_Time()
{
del_time del1 = new del_time(Lbl_time);
Thread.Sleep(1000);
while (true)
invoke(Lbl_time, new object[] { });
}protected void Lbl\_timp() { if (time > 0) { time -= 1; labelTime.Text = "TIME " + time.ToString(); } else { time = 60; labelTime.Text = "TIME " + time.ToString(); } }
Now can anyone tell me if I can do the stop watch this way, or could anyone give any other idea. I've noticed that I have a control called "Timer". I tried to use it, but I get the following error: "The control with ID 'Timer1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it." Any ideas??
-
Master PageHi! I have the next problem: I have a master page which has a textbox and a Web Content Form which is built from my master page. In the Web Content Form I have a button and I when I press it, I want the text from the textbox to update. For example when I view in browser my Web content form when I press my button, the text from the textbox should look like "You've press a button". Can anyone help me? Thanks!
-
Previous PageOk, here's my problem. I have two pages: one called FirstPage.aspx and the other one called SecondPage.aspx. Here's what I want to do... I start with FirstPage.aspx and here I have a button and when I click it SecondPage.aspx appears. I do that using Response.Redirect("SecondPage.aspx", false). Ok, now when it loads the second page I want to show in a label the name of the first page. How can I do that? If I have used the PostBackUrl property of the button from the first page, this would have been easy. I would have written in the SecondPage:
protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null) { Label1.Text = PreviousPage.Title; } }
But, I need to show the second page using Response.Redirect("SecondPage.aspx", false). So any help? -
PostBackUrlHere's my problem: I have a button and when I click it I want to open a new page. I know that I can do this thing very easy by setting the PostBackUrl property of the button. But here's what I want to do: on my page I have a textbox and, for example when I press the button I want to test the text from the TextBox and if it's ok I want to show the new page; if not I want to display a message. I want to do that using c# language, and not JavaScript. I've tried this:
protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text == "something") Button1.PostBackUrl = "NewPage.aspx"; else .................... }
Ok, everithing is fine until now. But when I press the button, assuming that in my textbox I've written "something", the NewPage isn't displayed. My current page is loaded again and when I press the button again then NewPage.aspx is displayed. And I don't know why this is happening. Can anyone help me please? -
PostBackUrlHere's my problem: I have a button and when I click it I want to open a new page. I know that I can do this thing very easy by setting the PostBackUrl property of the button. But here's what I want to do: on my page I have a textbox and, for example when I press the button I want to test the text from the TextBox and if it's ok I want to show the new page; if not I want to display a message. I want to do that using c# language, and not JavaScript. I've tried this:
protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text == "something") Button1.PostBackUrl = "NewPage.aspx"; else .................... }
Can anyone help me please? -
ASP PanelHi! I have a few problems. I have a panel and I want to implement the "mouse_over" method. I managed to implement the "mouse_click" method, because as you know asp.net doesn't provide these methods for a Panel. And also I would like to change the mouse sensitivity while my mouse is over the panel. Can anyone help me please? Any idea is appreciated..