why don't u call it on OnClientClick of button because u can able to do same thing from javascript also...
for example
function getEndDate2()
{
var noOfweeks = document.getElementById('txtString').innerHTML ;
var sEmployeeWeeklyOfDay = "Friday";
var DateStart = new Date();
DateStart.setDate(DateStart.getDate()+3);
document.getElementById('TextBox1').value = DateStart.getDate();
}
<asp:button id="btnClick" runat="server" text="Pass" onclientclick="getEndDate2()" xmlns:asp="#unknown" />