Tag: asp.net

redirect到ASP.Net中的当前页面

如何执行与Server.Transfer()redirect到当前显示的页面? 提交后,我想要一个已清空的表格。 还有什么其他/更好的方法可以用来实现?

无法启动网站IIS HRESULT:0x80070020)

我试图用我自己的IP发布自己创build的SSL证书的网站。 在我将网站添加到IIS并尝试运行后,我得到这个错误,我无法启动网站。 Internet信息服务(IIS)pipe理器 – 进程无法访问文件,因为正在被另一个进程使用。 (从HRESULTexception:0x80070020) 什么可能是这个问题的原因?

通过C#使用SmtpClient发送HTML邮件

如何发送HTML电子邮件? 我在这个答案中使用代码发送电子邮件与SmtpClient ,但他们总是纯文本,所以下面的示例消息中的链接没有这样格式化。 <p>Welcome to SiteName. To activate your account, visit this URL: <a href="http://SiteName.com/a?key=1234">http://SiteName.com/a?key=1234</a>.</p> 如何在我发送的电子邮件中启用HTML?

ASP.NET电子邮件validation器正则expression式

有谁知道ASP.NET的电子邮件validation程序使用的正则expression式是什么?

确认回传OnClientClickbuttonASP.NET

<asp:Button runat="server" ID="btnUserDelete" Text="Delete" CssClass="GreenLightButton" OnClick="BtnUserDelete_Click" OnClientClick="return UserDeleteConfirmation();" meta:resourcekey="BtnUserDeleteResource1" /> 我努力了: function UserDeleteConfirmation() { if (confirm("Are you sure you want to delete this user?")) return true; else return false; } 和 function UserDeleteConfirmation() { if (confirm("Are you sure you want to delete this user?")) { __doPostBack(btnUserDelete, ''); } return false; } 而他们都没有工作。

如何从代码隐藏中访问RouteData?

在使用ASP.Net路由时,如何从代码隐藏中获取RouteData? 我知道你可以从RouteHandler的GetHttpHander方法得到它(你得到了RequestContext),但是你能从代码隐藏中获得吗? 有没有像… RequestContext.Current.RouteData.Values["whatever"]; …你可以访问全局,就像你可以用HttpContext做的一样? 还是说RouteData只能从RouteHandler内部访问?

JSON中的.d是什么意思?

我有一个.NET webmethod,我从jQuery调用。 该方法返回一些在DIV元素中显示的HTML标记。 一旦我有我使用的答复 $("#div").html(result.d); 我的问题是,.d做什么? 我不喜欢使用我不完全理解的代码? 我可以使用Eval获得相同的结果吗?

使用Visual Studio 2012 RC的MVC 4 / Razor中的可移植类库

由于使用Visual Studio 2012 RC,因此在剃刀视图中使用可移植类库(.net 4.5&metroconfiguration文件)中的类时,会出现HttpCompileException。 例外:(德语翻译成英文,对不起) System.Web.HttpCompileException (0x80004005): c:\Users\user\AppData\Local\Temp\Temporary ASP.NET Files\root\1995167a\126b7c4d\App_Web_index.cshtml.1fbcdbb1.zaniprm5.0.cs(29): error CS0012: The type 'System.Object' is not in a referenced assembly is defined. Add a reference to the Assembly "System.Runtime, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a" added. at System.Web.Compilation.AssemblyBuilder.Compile() System.Web.Compilation.BuildProvidersCompiler.PerformBuild() System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) … 解决scheme结构 可移植类库(.net 4.5&metro profile) 公共类User {…} MVC 4(.net […]

使用Web.Config转换的高级任务

有谁知道是否有一种方法来“变换”特定的值部分,而不是取代整个值或属性? 例如,我有几个appSettings条目指定不同web服务的Url。 这些条目在开发环境中与生产环境略有不同。 有些人比其他人微不足道 <!– DEV ENTRY –> <appSettings> <add key="serviceName1_WebsService_Url" value="http://wsServiceName1.dev.domain.com/v1.2.3.4/entryPoint.asmx" /> <add key="serviceName2_WebsService_Url" value="http://ma1-lab.lab1.domain.com/v1.2.3.4/entryPoint.asmx" /> </appSettings> <!– PROD ENTRY –> <appSettings> <add key="serviceName1_WebsService_Url" value="http://wsServiceName1.prod.domain.com/v1.2.3.4/entryPoint.asmx" /> <add key="serviceName2_WebsService_Url" value="http://ws.ServiceName2.domain.com/v1.2.3.4/entryPoint.asmx" /> </appSettings> 请注意,在第一个条目中,唯一的区别是“.prod”中的“.dev”。 在第二项中,子域是不同的: “ws.ServiceName2”中的“ma1- lab.lab1” 到目前为止,我知道我可以在Web.Release.Config中做这样的事情: <add xdt:Locator="Match(key)" xdt:Transform="SetAttributes(value)" key="serviceName1_WebsService_Url" value="http://wsServiceName1.prod.domain.com/v1.2.3.4/entryPoint.asmx" /> <add xdt:Locator="Match(key)" xdt:Transform="SetAttributes(value)" key="serviceName2_WebsService_Url" value="http://ws.ServiceName2.domain.com/v1.2.3.4/entryPoint.asmx" /> 然而,每次该Web服务的版本更新,我将不得不更新Web.Release.Config,这打破了简化我的web.config更新的目的。 我知道我也可以将这个url分成不同的部分,并独立更新,但我宁愿把它全部放在一个关键字中。 我已经浏览了可用的web.config转换,但似乎没有齿轮towars我想要完成。 这些是我用作参考的网站: Vishal Joshi的博客 […]

MVC3 Valums Ajaxfile upload

我正在尝试使用valums ajax上传器。 http://valums.com/ajax-upload/ 我的页面上有以下内容: var button = $('#fileUpload')[0]; var uploader = new qq.FileUploader({ element: button, allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'], sizeLimit: 2147483647, // max size action: '/Admin/Home/Upload', multiple: false }); 它发布到我的控制器,但qqfile始终为空。 我试过这些: public ActionResult Upload(HttpPostedFile qqfile) AND HttpPostedFileBase file = Request.Files["file"]; 没有任何运气。 我发现在轨道上的ruby的例子,但不知道如何在MVC中实现它http://www.jigsawboys.com/2010/10/06/ruby-on-rails-ajax-file-upload-with-valum/ 在萤火虫中,我看到: http:// localhost:61143 / Admin / Home / Upload?qqfile = 2glonglonglongname + […]