我可以在html体内成功运行,例如......
<div id="myContainer" style="float: left; background-color: Blue; height: 100px;
width: 100px;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%">
<defs>
<lineargradient id="myLinearGradient" x1="0%" x2="0%" y1="0%" y2="100%">
<stop id="start" offset="50%" style="stop-color: White; stop-opacity: 1" />
<stop id="stop" offset="60%" style="stop-color: #99cd9f; stop-opacity: 1" />
</lineargradient>
</defs>
<circle cx="50px" cy="50px" r="50px" fill="url(#myLinearGradient)" />
</svg>
</div>
Run Code Online (Sandbox Code Playgroud)
但是,我需要使用javascript动态创建它.只创建圆圈工作得很好,当我将圆圈的填充指向它失败的线性渐变时 - 我只是得到一个黑色圆圈.
我想我没有正确设置stop'style'属性.我试过另一种方法无济于事,见下文......
我正在使用Chrome,并提前感谢!
在体内:
<body>
<div style="float: left; background-color: Blue; height: 100px;
width: 100px;">
<svg id="Svg1" xmlns="http://www.w3.org/2000/svg">
<defs id="mydefs">
</defs>
</svg>
</div>
</body>
My script:
<script>
// lineargradient
var myLinearGradient …Run Code Online (Sandbox Code Playgroud) (我对Linq to SQL完全不熟悉)我正在创建一个与数据库密切配合的Web应用程序,我正在寻找最快且连接时间有效的模型,并且相信Linq to SQL就是这样.我正在使用C#/.Net4/Visual Studio 2010
为简单起见,我有一个包含许多asp文本框的web .aspx页面.我想将他们的Text值从SQL数据通过Linq提供给SQL对象.我还有一个名为DataClasses.dbml的文件,在设计视图中添加了一个表.到目前为止我在网页代码隐藏中的代码是:
DataClassesDataContext db = new DataClassesDataContext(getConnectionString);
var table = from t in db.MyTable
where t.PK == 2
select new { t.col1, t.col2, t.col3};
db.Connection.Open();
db. // What's the best way of loading the object?
db.Connection.Close();
Run Code Online (Sandbox Code Playgroud)
然后,我如何访问列值?或者我将它数据绑定到数据表?如果是这样,怎么样?
myTextBox1.Text = table.???col1.value;
Run Code Online (Sandbox Code Playgroud) 我有一个网络表单,有人可以设置一个帐户 - 我想给他们发送电子邮件确认.
我正在使用的代码:
// Create e-mail message
MailMessage mm = new MailMessage();
mm.From = new MailAddress("OurOrganisationEmail@ourdomain.com", "Our Organisation");
mm.To.Add(new MailAddress("webuser@domain.com", "Web User"));
mm.Subject = "Confirmation";
mm.Body = "You are now registered test";
mm.IsBodyHtml = true;
// Send e-mail
sc = new SmtpClient();
NetworkCredential basicAuthenticationInfo = new NetworkCredential(“OurOrganisationEmail@ourdomain.com”, “ourorganisationemailPassword”);
sc.Credentials = basicAuthenticationInfo;
sc.UseDefaultCredentials = false;
sc.Send(mm);
Run Code Online (Sandbox Code Playgroud)
web.config中:
<system.net>
<mailSettings>
<smtp>
<network host="mail.OurOrganisationEmail@ourdomain.com" port="9999" userName="OurOrganisationEmail@ourdomain.com" password="OurOrganisationEmailPassword"/>
</smtp>
</mailSettings>
</system.net>
Run Code Online (Sandbox Code Playgroud)
但得到:
System.Net.Mail.SmtpFailedRecipientException was caught
HResult=-2146233088
Message=Mailbox unavailable. The server response was: Authentication …Run Code Online (Sandbox Code Playgroud) c# ×2
asp.net ×1
asp.net-4.0 ×1
datacontext ×1
javascript ×1
linq-to-sql ×1
smtpclient ×1
svg ×1
web-config ×1