Archive for January, 2009

Response.Redirect() and JavaScript

A toucan perched on a branch in Brazil. Yesterday we covered issues surrounding using Response.Redirect in server side code. We noted that not handing it correctly could prevent code from running on the server that we want to run.

The other issue is emitting Javascript in the server side in association with Response.Redirect(). This also leads to unexpected problems if you aren’t thinking about what is actually happening with your code.

Read the rest of this entry »

Response.Redirect() executes too soon on the Server.

tp_vol4_017 I’ve seen this question a couple of times in various situations. The first involves Javascript and the second involves server side code. Both are caused by a misunderstanding of what this function does and how web pages work.

Let’s start with the easy one: server side code.

Read the rest of this entry »

ASP.NET JSON and ViewState

imageI received the following question recently about my article “ASP.NET AJAX using JSON – Here’s how.

If we update the value of a textbox or label via a JSON web service call – will the value of that textbox/label be written to the viewstate or whatever so that the server side code can see the new values that came from the JSON request?

The short answer is, “no, it will not update viewstate.”  But I think it would be helpful to understand when this is important rather than just giving you a blanket answer.

Read the rest of this entry »

Friday Books – Teach Yourself ASP.NET

SAMsTeachYourselfASP.NET3.5ProgrammingIn24HoursSams Teach Yourself ASP.NET 3.5 in 24 Hours

In just 24 sessions of one hour or less, you will be up and running with ASP.NET 3.5. Using a straightforward, step-by-step approach, each lesson builds upon a real-world foundation forged in both technology and business matters, allowing you to learn the essentials of building dynamic, data-driven web applications from the ground up.

Step-by-step instructions carefully walk you through the most common questions, issues, and tasks.

Read the rest of this entry »

jQuery – Retrieving HTML Fragments

sunset-bird A couple of weeks ago I mentioned that I had built a tooltip using jQuery.  We focused mostly on the positioning of the tooltip at the time because, historically, that’s where most of the work has been.

But there are other time-saving features that also make the tooltip code I wrote a lot more flexible.

Read the rest of this entry »

Bear