Tuesday

ASP.NET/csharp:FileUpload inside AJAX Update panel

To make it working it's required :
1.Created interface:

public interface ITriggerable {
void RegisterPostbackTrigger(Control parent,Control trigger);
}


2.implement this interface on page containing ajax update panel:

public void RegisterPostbackTrigger(Control parent,Control button){
PostBackTrigger trigger = new PostBackTrigger();
trigger.ControlID =((Button) button).UniqueID;
UpdatePanel1.Triggers.Add(trigger);
}


3.Add button inside of control as trigger:

protected override void OnInit(EventArgs e){
base.OnInit(e);
((ITriggerable)this.Page).RegisterPostbackTrigger(this, btnRename);
}

No comments:

test smtp server with powershell

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