asp.net-4.0

Font awesome inside asp button

前提是你 提交于 2019-11-27 07:34:46
This is my asp:button code which is not rendering font awesome's icon but instead shows the HTML as it is: <asp:Button runat="server" ID="btnRun" Text="<i class='icon-camera-retro'></i> Search" ValidationGroup="edt" OnClick="btnRun_Click" CssClass="greenButton"/> Any idea how can I solve this issue? You can't with the default asp.net button you will need to use a HTML button and give it runat=server attribute: <button runat="server" id="btnRun" class="btn btn-mini" title="Search"> <i class="icon-camera-retro"></i> Search </button> So use code behind with this you add: onserverclick=

ASP.NET 4.0 URL Routing HTTP Error 404.0 - Not Found

寵の児 提交于 2019-11-27 05:34:24
问题 I have implemented URL routing in ASP.NET 4.0 using following route. routes.MapPageRoute( "NewsDetails", // Route name "news/{i}/{*n}", // Route URL "~/newsdetails.aspx" // Web page to handle route ); which gives me url like http://www.mysie.com/news/1/this-is-test-news and this is working in my localhost fine. But when I uploaded it on the server it gives ... Server Error 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is

.Net 4.0 website cannot identify some AppleWebKit based browsers

你离开我真会死。 提交于 2019-11-27 02:10:59
问题 We are seeing some Safari browsers failing to cross-authenticate our website after we upgrade to .NET 4.0 from .NET 3.5. After much investigation, it turns out to be a problem with ASP.NET identifying the Safari browsers properly. ASP.NET identifies some Safari (possibly other WebKit-based browsers) as Mozilla Version 0.0. browsers that do not support cookies, frames, JavaScript, etc. .NET 3.5 does not have any problems identifying these browsers. We have simplified testing down to a simple

Request Validation - ASP.NET MVC 2

若如初见. 提交于 2019-11-27 02:08:19
问题 Has request validation changed for ASP.NET MVC 2, more precisely, not validating? I did the following: Web.configs (in App directory and Views directory) <pages validateRequest="false" Controller/Action Attribute [ValidateInput(false)] In @Page View Directive ValidateRequest="false" The page still gets validated an exception is thrown when HTML content is posted. UPDATE Created a new ASP.NET MVC 2 Application and I modified the Home Controller's Index to this [ValidateInput(false)] public

System.InvalidOperationException: Stack empty

泪湿孤枕 提交于 2019-11-27 01:52:37
问题 Once running ASP.NET 4.x application built in Visual Studio 2013 I am getting the below exception. I have tried to disable the PageInspector by removing page inspector assembly <assemblies> <remove assembly="Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> </assemblies> and adding this configuration to app settings <appSettings> <add key="PageInspector:ServerCodeMappingSupport" value="Disabled"/> </appSettings> Nothing

Store String Array In appSettings?

折月煮酒 提交于 2019-11-27 01:42:43
I'd like to store a one dimensional string array as an entry in my appSettings . I can't simply separate elements with , or | because the elements themselves could contain those characters. I was thinking of storing the array as JSON then deserializing it using the JavaScriptSerializer . Is there a "right" / better way to do this? (My JSON idea feels kinda hacky) You could use the AppSettings with a System.Collections.Specialized.StringCollection . var myStringCollection = Properties.Settings.Default.MyCollection; foreach (String value in myCollection) { // do something } Each value is

Why is using a URL containing a colon considered as a “potentially dangerous request”?

余生颓废 提交于 2019-11-27 01:34:58
问题 Someone (probably a bot) sent a request with the following URL to my ASP.NET 4.0 web forms application (running on IIS 7.0): http://ipaddress-of-my-applications-domain/bla1.bla2.bla3.bla4.bla5:) This caused an System.Web.HttpException . I received a logging email from ASP.NET HealthMonitoring I had configured, telling me: A potentially dangerous Request.Path value was detected from the client (:). Stack trace was: System.Web.HttpRequest.ValidateInputIfRequiredByConfig() System.Web

How do I access HttpContext.Current in Task.Factory.StartNew?

青春壹個敷衍的年華 提交于 2019-11-27 01:20:07
问题 I want to access HttpContext.Current in my asp.net application within Task.Factory.Start(() =>{ //HttpContext.Current is null here }); How can I fix this error? 回答1: Task.Factory.Start will fire up a new Thread and because the HttpContext.Context is local to a thread it won't be automaticly copied to the new Thread , so you need to pass it by hand: var task = Task.Factory.StartNew( state => { var context = (HttpContext) state; //use context }, HttpContext.Current); 回答2: You could use a

ASP.net Getting the error “Access to the path is denied.” while trying to upload files to my Windows Server 2008 R2 Web server

妖精的绣舞 提交于 2019-11-27 00:19:20
I have an asp.net webapplication that uploads files to a specific folder on the Web server. locally everything works fine, but when I deploy the application to the Webserver, I begin getting the error "Access to the path "D:\Attachments\myfile.doc" is denied". I gave the "IIS AppPool" user that the application is running under full permission on the folder. I even gave "Everyone" full permissions, but with the same error. I added the folder to the Exceptions list of the Antivirus, but with the same result. I am begining to suspect that maybe Windows Server 2008 R2 needs a trick for my upload

ASP.NET 2.0 and 4.0 seem to treat the root url differently in Forms Authentication

回眸只為那壹抹淺笑 提交于 2019-11-26 23:17:25
问题 If have the following web.config : <configuration> <system.web> <authentication mode="Forms"> <forms name="MembershipCookie" loginUrl="Login.aspx" protection="All" timeout="525600" slidingExpiration="true" enableCrossAppRedirects="true" path="/" /> </authentication> <authorization> <deny users="?" /> </authorization> </system.web> <location path="Default.aspx"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> </configuration> The application is an ASP