Thursday, August 11, 2011

SQL Cascading Query

11:12 PM Posted by Unknown No comments
with MessageList
as
(
select MessageID_,ParentID_ from Messages_ where ParentID_='3529'
union all
select m.MessageID_,m.ParentID_ from Messages_ m inner join MessageList ml on m.ParentID_= ml.MessageID_
)
SELECT distinct(MessageID_) FROM MessageList group by MessageID_

Tuesday, June 28, 2011

Testing mail locally

10:54 PM Posted by Unknown 1 comment
1. Create a temp folder.

http://blog.divergencehosting.com/2010/01/27/testing-email-from-localhost-with-aspnet-without-smtp-server/

2. The mails sent will be available at that temp folder.

Saturday, April 16, 2011

JavaScript in UpdatePanel

11:13 PM Posted by Unknown , , No comments
Javascript events don't work after the UpdatePanel does a partial page update.

An UpdatePanel completely replaces the contents of the update panel on an update. This means that those events you subscribed to are no longer subscribed because there are new elements in that update panel.

Soln1: Re-subscribe to the events I need after every update. I use $(document).ready() for the initial load, then this snippet below to re-subscribe every update.

var prm = Sys.WebForms.PageRequestManager.getInstance();

prm.add_endRequest(function() {
// re-bind your jquery events here
});

The PageRequestManager is a javascript object which is automatically available if an update panel is on the page. You shouldn't need to do anything other than the code above in order to use it as long as the UpdatePanel is on the page.

Soln2: Use jQuery's live() event subscriber
$(document).ready(function () {
$("#Button2").live("click", function () {
alert("test");
});

});


Soln3:


where bind is the jquery function

Where bind is the jquery function