摘要:
1 在web.config中添加配置信息<configuration><connectionStrings><add name="conStr" connectionString="server=localhost;database=master;uid=sa;pwd="/></connectionStrings></configuration>*******************************/// dbcon 数据库的连接类,可调用静态函数创建/// </summary&g 阅读全文
摘要:
Web.config: <appSettings> <add key= "ConnectionString " value= "data source=****;initial catalog=****;persist security info=False;user id=****;pwd=**** " /> </appSettings> Get it: string strConn = ConfigurationSettings.AppSettings[ "ConnectionString "] 阅读全文
摘要:
.net方法namespace Controllers{ public class DocumentController { public ActionResult Index() { return View(); } public string GetDocumentUrl() { return Comment.documentUrl; } }}这中方式取不到值,原来我使用dataType:'json' 而。net中的方法返回值是string类型的。改成dataType: 'Text'就好了,或者直接去掉dataType:'json' 它会自动 阅读全文