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

ASP.NET

 
QuestionWeb server Pin
dhulipudi9-Jan-07 15:53
dhulipudi9-Jan-07 15:53 
AnswerRe: Web server Pin
Not Active9-Jan-07 15:57
mentorNot Active9-Jan-07 15:57 
AnswerRe: Web server Pin
vurugonda9-Jan-07 16:18
vurugonda9-Jan-07 16:18 
GeneralRe: Web server Pin
Not Active9-Jan-07 16:23
mentorNot Active9-Jan-07 16:23 
GeneralRe: Web server Pin
dhulipudi10-Jan-07 16:07
dhulipudi10-Jan-07 16:07 
Questionaccessing dbf file Pin
Harikrk9-Jan-07 14:10
Harikrk9-Jan-07 14:10 
AnswerRe: accessing dbf file Pin
Venkatesh Mookkan9-Jan-07 15:38
Venkatesh Mookkan9-Jan-07 15:38 
QuestionProblem with page's button click event handler Pin
Tina P9-Jan-07 13:05
Tina P9-Jan-07 13:05 
Guys, I’m trying to debug a web page I created, based on users selection from the drop down lists, I’m changing the preferences on the page (such as background color, text, font etc). Now the problem I’m running into is that it only happens when I click the button twice. The first time button gets clicked, nothing happens but there is a post back to itself. When I try to debug it by setting break points, I see that when the control gets returned back to the browser and I click the submit button after selecting the properties from the drop down lists, it goes through the code for the event handler (btn_Click()) and then when it reaches the end, it comes back to the top of the event handler (btn_Click())
and goes through the code again. When it finish executing it again, VS.Net (2003 ) opens up an error message box saying there is no more source code to execute and that DO YOU want to see the disassembled code. I’m not quite understanding why is it happening? BTW I’m using cookies to store the values from the drop down so I can use them on subsequent pages. Also I’m using inline styles sheets and in aspx changing the properties of body and table elements for instance. But that still doesn’t explain why it needs the button clicked twice??? Can someone please explain? The code is shown below:

<br />
<br />
private void Page_Load(object sender, System.EventArgs e)<br />
		{<br />
			if (!IsPostBack)<br />
			{<br />
				HttpCookie cookie = Request.Cookies["preferences1"];<br />
				ViewState["Referer"] = Request.Headers["Referer"];<br />
          <br />
				if ( cookie != null )<br />
				{<br />
					BackColor.SelectedItem.Value = (string)cookie.Values["BackColor"];<br />
					ForeColor.SelectedItem.Value = (string)cookie.Values["ForeColor"];<br />
					FontSize.SelectedItem.Value = (string)cookie.Values["FontSize"];<br />
					FontName.SelectedItem.Value = (string)cookie.Values["FontName"];<br />
					NavControl.SelectedItem.Value = (string)cookie.Values["NavControl"];<br />
				}<br />
			}<br />
			globalNav2.Visible = false;<br />
		}<br />
<br />
<br />
<br />
		public void btnSubmit_Click(object sender, System.EventArgs e)<br />
		{<br />
				//HttpCookie cookie = Request.Cookies["preferences1"];<br />
<br />
				HttpCookie cookie = new HttpCookie("preferences1");<br />
<br />
// where ForeColor, BackColor and others are just the IDs of the Drop down lists.<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 />
<br />

AnswerRe: Problem with page's button click event handler Pin
Venkatesh Mookkan9-Jan-07 15:44
Venkatesh Mookkan9-Jan-07 15:44 
GeneralRe: Problem with page's button click event handler Pin
Tina P9-Jan-07 16:10
Tina P9-Jan-07 16:10 
GeneralRe: Problem with page's button click event handler Pin
Not Active9-Jan-07 16:31
mentorNot Active9-Jan-07 16:31 
QuestionRe: Problem with page's button click event handler Pin
Venkatesh Mookkan9-Jan-07 17:30
Venkatesh Mookkan9-Jan-07 17:30 
AnswerRe: Problem with page's button click event handler Pin
Not Active10-Jan-07 2:18
mentorNot Active10-Jan-07 2:18 
GeneralRe: Problem with page's button click event handler Pin
Not Active9-Jan-07 16:20
mentorNot Active9-Jan-07 16:20 
AnswerRe: Problem with page's button click event handler Pin
Not Active9-Jan-07 16:29
mentorNot Active9-Jan-07 16:29 
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 
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 

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.