Dicas de programação, tratamento de imagens, webdesign

PaidVerts

Archive for fevereiro, 2020

Response.Redirect em uma nova janela

Utilize esse método:

protected static void Redirect(string url, string target, string windowFeatures)
{
HttpContext context = HttpContext.Current;
if ((String.IsNullOrEmpty(target) || target.Equals(“_self”, StringComparison.OrdinalIgnoreCase)) &&
String.IsNullOrEmpty(windowFeatures))
{
context.Response.Redirect(url);
}
else
{
var page = (Page)context.Handler;
if (page == null)
{
throw new InvalidOperationException(“Cannot redirect to new window outside Page context.”);
}
url = page.ResolveClientUrl(url);
string script = !String.IsNullOrEmpty(windowFeatures) ? @”window.open(“”{0}”", “”{1}”", “”{2}”");” : @”window.open(“”{0}”", “”{1}”");”;
script = String.Format(script, url, target, windowFeatures);
ScriptManager.RegisterStartupScript(page, typeof(Page), “Redirect”, script, true);
}
}

Para Utilizaar basta chamar Redirect(“pagina.aspx”, “_blank”, “”);

ref.:http://devbrasil.net/group/aspnet/forum/topics/responseredirect-em-uma-nova

Criar QR code c#

http://www.macoratti.net/15/06/c_qrcd1.htm

https://www.codeproject.com/Questions/607356/HowplustopluscreateplusQRplusCodeplusencodeplusand

Ordernar datatable c#

dt.DefaultView.Sort = “Parameter_Name”;
Datatable.DefaultView.Sort = “Preferance ASC”;
dt = dt.DefaultView.ToTable();

Tag Cloud