我有一个网站,我希望在浏览器窗口调整大小方面具有与 Stackoverflow 类似的布局。
所以我有以下CSS:
#site-container {
margin: 0px auto;
text-align: left;
width: 100%;
zoom: 1;
position: relative;
}
body {
font-family: arial, helvetica, sans-serif;
font-size: 81.25%;
background-color: #fbf9ef;
}
#div-menu {
display: inline;
}
#header {
width: 990px;
height: 80px;
margin-left : 127px;
margin-right : 127px;
margin-bottom: 12px;
margin-top: 20px;
border-bottom: 1px solid #c0c0c0;
}
#content {
width: 990px;
margin-left : 127px;
margin-right : 127px;
}
Run Code Online (Sandbox Code Playgroud)
然而,当我调整浏览器窗口大小时,它的行为与 Stackoverflow 不同,不知何故 Stackoverflow 似乎是浮动的,并根据浏览器窗口大小自动减少边距。
谢谢
我有一个WebApi控制器,其中一个部分是向一组用户发送电子邮件.
[HttpPost]
[Authorize]
[Route("{id}/Do")]
public async Task<HttpResponseMessage> Post(int id, Model model)
...
await _emailService.SendAsync(message);
...
Run Code Online (Sandbox Code Playgroud)
现在发送电子邮件的方法(SendGrid)
public override async Task SendAsync(MailMessage message)
{
var client =
new SmtpClient(SendGridServerName, SendGridServerPort)
{
Port = SendGridServerPort,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false
};
var credentials = new NetworkCredential(SendGridUserName, SendGridPassword);
client.EnableSsl = true;
client.Credentials = credentials;
message.From = new MailAddress(FromAddress);
await client.SendMailAsync(message);
}
Run Code Online (Sandbox Code Playgroud)
一切正常,但速度很慢.我期待它快,但await _emailService.SendAsync(message);看起来并不是异步.它停在那里一段时间.
有任何想法吗?
谢谢
我正在尝试将我的ASP身份逻辑移动到我的解决方案中的另一个项目.
一切都很好,除了我无法访问HttpContext我的参考库.我需要访问HttpContext使用的种子数据库ApplicationUserManager.
public class ApplicationDbInitializer : DropCreateDatabaseIfModelChanges<ApplicationDbContext>
{
protected override void Seed(ApplicationDbContext context)
{
InitializeIdentityForEF(context);
base.Seed(context);
}
public static void InitializeIdentityForEF(ApplicationDbContext db)
{
var userManager = HttpContext.Current.GetOwinContext().GetUserManager<ApplicationUserManager>();
var roleManager = HttpContext.Current.GetOwinContext().Get<ApplicationRoleManager>();
// Create here users and roles using userManager and roleManager
}
}
Run Code Online (Sandbox Code Playgroud)
所以问题是:如何访问ApplicationUserManager和ApplicationRoleManager不访问HttpContext,或者我如何访问HttpContext此处.
非常感谢
我已经在使用Google的字体,它可以按预期工作:
@font-face {
font-family: 'Chivo';
font-style: normal;
font-weight: 900;
src: local('Chivo Black'), url(http://themes.googleusercontent.com/static/fonts/chivo/v4/uOXSiKkEygwkvR4cgUzOz_esZW2xOQ-xsNqO47m55DA.woff) format('woff');
}
Run Code Online (Sandbox Code Playgroud)
现在,我需要Google提供的另一种字体,但我不知道在哪里选择该网址。我可以在Google字体上看到的唯一网址是(例如,该字体):
<link href='http://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
Run Code Online (Sandbox Code Playgroud)
但是googleapis网址不起作用,如果我用该网址替换src,则不会加载任何字体。
我有一张表,其中有以下事件:
$("#tp-active-list-table td").click(function () {
var transactionNbr = parseInt($(this).parent("tr").children('td.td-transaction-nbr').html());
DoSomething(transactionNbr);
});
Run Code Online (Sandbox Code Playgroud)
它工作正常,基本上它调用DoSomething与Number各自收集的td.
但我确实有一个问题,因为在其中一个td我有一个锚点,如果在该锚点上执行点击,那么DoSomething将运行,页面将正确导航到另一个URL.
无论如何都要检查点击是否在那anchor以避免运行该DoSomething功能?
c# ×2
css ×2
asp.net ×1
asp.net-mvc ×1
asynchronous ×1
css3 ×1
email ×1
html ×1
javascript ×1
jquery ×1
sendgrid ×1