Click here to Skip to main content
15,917,473 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Problem with page's button click event handler Pin
Tina P9-Jan-07 16:40
Tina P9-Jan-07 16:40 
GeneralRe: Problem with page's button click event handler Pin
Not Active9-Jan-07 16:54
mentorNot Active9-Jan-07 16:54 
GeneralRe: Problem with page's button click event handler Pin
Tina P9-Jan-07 17:07
Tina P9-Jan-07 17:07 
GeneralRe: Problem with page's button click event handler Pin
Not Active9-Jan-07 17:24
mentorNot Active9-Jan-07 17:24 
GeneralRe: Problem with page's button click event handler Pin
Tina P9-Jan-07 18:10
Tina P9-Jan-07 18:10 
GeneralRe: Problem with page's button click event handler Pin
Not Active9-Jan-07 19:09
mentorNot Active9-Jan-07 19:09 
GeneralRe: Problem with page's button click event handler Pin
Tina P10-Jan-07 5:40
Tina P10-Jan-07 5:40 
GeneralRe: Problem with page's button click event handler Pin
Tina P11-Jan-07 13:09
Tina P11-Jan-07 13:09 
Hi Mark, isn’t that true that Page_Init event is where all the controls on the page gets initialized before the page actually loads. Well if that’s the case than my problems should have been fixed.

I added this handler into my code behind and explicitly wired it too (this.Init += new System.EventHandler(this.Page_Init))
 <br />
private void Page_Init(object sender, System.EventArgs e)<br />
		{<br />
			HttpCookie cookie = new HttpCookie("preferences1");<br />
<br />
			if(IsPostBack)<br />
			{<br />
			cookie.Values.Add("ForeColor",ForeColor.SelectedItem.Value);<br />
			cookie.Values.Add("BackColor",BackColor.SelectedItem.Value);<br />
			cookie.Values.Add("FontSize",FontSize.SelectedItem.Value);<br />
			cookie.Values.Add("FontName",FontName.SelectedItem.Value);<br />
			cookie.Values.Add("NavControl",NavControl.SelectedItem.Value);<br />
<br />
				Response.AppendCookie(cookie);<br />
			}<br />
		}<br />


But now as you would imagine….its going through the init event at the very first time page is accessed…but at that point of course it doesn’t have the right value from the drop down. Then it goes through page load and then Page_click (same code) and then I get the right values there (in debug mode). The page only gets updated when the button gets clicked and in the debug more it doesn’t even get to the point where I can click the button once again. It says finish executing code, wanna see disassembly? Can you please help??
Questionimage casting in .NET Pin
Member 9571479-Jan-07 12:40
Member 9571479-Jan-07 12:40 
QuestionDisable a button Pin
ssircar19719-Jan-07 11:01
ssircar19719-Jan-07 11:01 
AnswerRe: Disable a button Pin
Jon Sagara9-Jan-07 11:32
Jon Sagara9-Jan-07 11:32 
QuestionNeeds assistance in displaying data in Tree view Pin
Skanless9-Jan-07 10:28
Skanless9-Jan-07 10:28 
QuestionASP.NET 2.0 and AJAX Pin
RX Maverick9-Jan-07 10:03
RX Maverick9-Jan-07 10:03 
AnswerRe: ASP.NET 2.0 and AJAX Pin
Christian Graus9-Jan-07 12:19
protectorChristian Graus9-Jan-07 12:19 
QuestionpageBaseType Pin
Brendan Vogt9-Jan-07 8:57
Brendan Vogt9-Jan-07 8:57 
AnswerRe: pageBaseType Pin
Christian Graus9-Jan-07 12:28
protectorChristian Graus9-Jan-07 12:28 
AnswerRe: pageBaseType Pin
Mike Ellison9-Jan-07 12:33
Mike Ellison9-Jan-07 12:33 
GeneralRe: pageBaseType Pin
Brendan Vogt11-Jan-07 7:26
Brendan Vogt11-Jan-07 7:26 
Questionhow to capture content markup within an httpmodule? [modified] Pin
jszpila9-Jan-07 8:44
jszpila9-Jan-07 8:44 
AnswerRe: how to capture content markup within an httpmodule? Pin
Mike Ellison9-Jan-07 12:29
Mike Ellison9-Jan-07 12:29 
GeneralRe: how to capture content markup within an httpmodule? Pin
jszpila10-Jan-07 6:24
jszpila10-Jan-07 6:24 
QuestionWeb Service Pin
Rahithi9-Jan-07 8:02
Rahithi9-Jan-07 8:02 
AnswerRe: Web Service Pin
ednrgc9-Jan-07 8:24
ednrgc9-Jan-07 8:24 
GeneralRe: Web Service Pin
Rahithi9-Jan-07 8:46
Rahithi9-Jan-07 8:46 
GeneralRe: Web Service Pin
ednrgc9-Jan-07 8:48
ednrgc9-Jan-07 8:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.