Tuesday

@html.dropdownlistfor onchange


here is how to add javascript onchange function to DropDownListFor MVC helper:
     
@Html.DropDownListFor(m => m.SettingValue, new SelectList(Model.globalTypes, "TypeCode", "TypeName"), new { onchange = "SettingChanged()" })



Friday

jquery save and restore form data

Here is sample how to store and retrieve form and retrieve data
 
// get all form values into json
var s2=$('form').values();
// restore all forms values back
$('form').values(s2);


Here is the function
    
/* function for form saving restoring code */
$.fn.values = function (data) {
var els = $(this).find(':input').get();

if (typeof data != 'object') {
// return all data
data = {};
$.each(els, function () {
if (this.name && !this.disabled && this.type != "hidden") {
if (this.type == 'checkbox') {
data[this.name] = $(this).is(":checked");

} else if (this.type == 'radio') {
if ($(this).is(":checked")) {
data[this.name] = $(this).val();
}
} else {
data[this.name] = $(this).val();
}

}
});
return data;
} else {
$.each(els, function () {
if (this.name && data[this.name] != null) {
//console.log(">" + this.name + " " + data[this.name]);
if (this.type == 'checkbox') {
$(this).attr("checked", data[this.name]); //(data[this.name] == $(this).val())
//console.log("checkbox");
} else if (this.type == 'radio') {
$(this).attr("checked", data[this.name] == $(this).val());
} else {
$(this).val(data[this.name]);
}
}
});
return $(this);
}
};


Product Opportunity Assessment

1. Exactly what problem will this solve? (value proposition)
2. For whom do we solve that problem? (target market)
3. How big is the opportunity? (market size)
4. What alternatives are out there? (competitive landscape)
5. Why are we best suited to pursue this? (our differentiator)
6. Why now? (market window)
7. How will we get this product to market? (go-to-market strategy)
8. How will we measure success/make money from this product? (metrics/revenue strategy)
9. What factors are critical to success? (solution requirements)
10. Given the above, what’s the recommendation? (go or no-go)

test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...