Tag: dotnetnuke

以其他用户身份登录时丢失会话/ cookie

我正在构建dnn模块,允许登录用户以其他用户身份登录。 但我这里有一些有线问题。 这是我注销当前用户和以其他用户身份登录的方式: UserInfo userInfo = UserController.GetUserById(portalId, userId); if (userInfo != null) { DataCache.ClearUserCache(this.PortalSettings.PortalId, Context.User.Identity.Name); if (Session[“super_userId”] == null) { Session[“super_userId”] = this.UserId; Session[“super_username”] = this.UserInfo.Username; } HttpCookie impersonatorCookie = new HttpCookie(“cookieName”); impersonatorCookie.Expires = DateTime.Now.AddHours(1); Response.Cookies.Add(impersonatorCookie); Response.Cookies[“cookieName”][“super_userId”] = this.UserId.ToString(); Response.Cookies[“cookieName”][“super_username”] = this.UserInfo.Username; PortalSecurity objPortalSecurity = new PortalSecurity(); objPortalSecurity.SignOut(); UserController.UserLogin(portalId, userInfo, this.PortalSettings.PortalName, Request.UserHostAddress, false); Response.Redirect(Request.RawUrl, true); […]

如何在DotnetNuke 7中暂时存储数据?

我是DotnetNuke的新手。 随意建议我正确的术语。 我正在研究DotnetNuke 7.我使用C#。 我有一个包含30个字符串字段的表,它最多可以有50个记录。 目前我正在使用数据库进行管理。 我认为数据并不多,我应该将它存储在本地存储(如果有的话)中,这比从数据库中获取数据要快。 如果在DotnetNuke中有任何本地存储(临时)和生命,有人可以建议我吗? 另外请告诉我关于切换本地存储而不是数据库的想法。

this.Controls不包含所有控件

特别是跳过了一个文本框。 ID为“q3TXT”的文本框位于在PageLoad方法中隐藏的面板内。 然而,在收集控件的函数之前,它变得可见。 收集每个其他文本框。 我试过IEnumberable文本框集合,但没有用。 如何让文本框出现在控件列表中? 这是html: If no, when did data collection stop? 和c#代码的一部分: foreach (var item in this.Controls.OfType()) { //some code }

DotNetNuke.Services.Mail.Mail.SendEmail和DotNetNuke.Services.Mail.Mail.SendMail之间的区别

我想在DNN模块中注册过程后发送电子邮件。 当我搜索时,我发现在dnn中有一个内置的邮件类。 但它包含两种方法 – SendEmail和SendMail 。 这两者有什么区别?在这种情况下我必须选择哪一个。

打印到DotNetNuke事件日志/查看器

出于调试目的,如何使用VB.NET或C#打印到DotNetNuke中的事件日志/查看器?

安装DotNetNuke:数据库连接失败

我试图在我的本地计算机上设置DNN,但有以下错误。 安装DotNetNuke 升级错误:错误:无法连接到SqlDataProvider的connectionString中指定的数据库 我安装了SQL Server 2014 Express并创建了自定义登录。 我可以使用SQL Management Studio登录和访问具有相同凭据的数据库。 在web.config文件中,我有以下数据库连接行: <add name="SiteSqlServer" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=;User ID=;Password=” providerName=”System.Data.SqlClient” /> <add name="SiteSqlServerAcuity" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=;User ID=;Password=” providerName=”System.Data.SqlClient” /> <add name="AcuityEntities" connectionString="metadata=res://*/DAO.Model.SalesAcuity.csdl|res://*/DAO.Model.SalesAcuity.ssdl|res://*/DAO.Model.SalesAcuity.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;Initial Catalog=;Persist Security Info=True;User ID=;Password=;MultipleActiveResultSets=True;Application Name=EntityFramework"” providerName=”System.Data.EntityClient” /> 和 <add key="SiteSqlServer" value="Data Source=.\SQLEXPRESS;Initial Catalog=;User ID=;Password=”> 我根据互联网上的许多参考资料validation并更改了两个部分中的连接字符串,但没有一个工作。 是否需要其他配置? 或者web.config或Database配置中需要进行哪些更改? 这不是DFAULT DOTNETNUKE PACKAGE。 它是一个我正在尝试设置的定制项目。

连接到CRM

我需要我的网站连接到CRM这是我的代码 var organizationUri = new Uri(ConfigurationManager.AppSettings[“CRMServerUrl”]); //Client credentials var credentials = new ClientCredentials(); credentials.UserName.UserName = @””; credentials.UserName.Password = “”; // Use the Microsoft Dynamics CRM Online connection string from the web.config file named “CrmConnectionStr”. using (OrganizationServiceProxy _service = new OrganizationServiceProxy(organizationUri, null, credentials, null)) { Response.Write(“Connected”); } 这是在我的web.config中 <add key="username" value="” /> <add key="password" value="” /> […]