asp.net-2.0

AddEntityFrameworkStores can only be called with a user that derives from IdentityUser<TKey>

冷暖自知 提交于 2019-12-11 15:41:52
问题 I'm trying to create some roles for my web application but it isn't really working because of a Tkey exception . I don't know how I can fix it. I think there is a problem with my Startup.cs. Whatever i try to add the DefaultIdentity and adding the roles. Startup.cs - On this line I get an Error: services.AddDefaultIdentity<IdentityRole>().AddRoles<IdentityRole>().AddDefaultUI().AddEntityFrameworkStores<VerwaltungsprogrammContext>(); This is the Error Message: AddEntityFrameworkStores can only

SqlMembershipProvider question

假如想象 提交于 2019-12-11 14:51:40
问题 When you create the Register Control for the SqlMembersipProvider nothing happens if they register and the username or email is in use. Is there a tutorial or override function that fixes this in asp.net 2.0 回答1: You may need to register an event handler for the LoginError event. See this article for lots of details: http://aspnet.4guysfromrolla.com/articles/120705-1.aspx 回答2: You most certainly should see a red error message indicating that the operation failed and why. If you do not see

Correctly matching an ending tag with its starting tag in HTML with a RegEx

梦想的初衷 提交于 2019-12-11 14:07:36
问题 I'm using VB.Net in an ASP.Net 2.0 app to run some regular expressions that remove some unnecessary markup. One of the things that I'd like to do is remove span elements that don't have any attributes in them: output = Regex.Replace(output, "<span\s*>(?<Text>.*?)</span>" & styleRegex, "${Text}", RegexOptions.Compiled Or RegexOptions.CultureInvariant Or RegexOptions.IgnoreCase Or RegexOptions.Singleline) So for this content: <span>Lorem <span class="special">ipsum</span> dolor sit amet.</span>

Passing Form fields which have been generated by User Control

随声附和 提交于 2019-12-11 12:44:16
问题 I'm having real troubles passing form data from a posting page made up of User Controls. I posted this question before, here, Getting form field names on Submit when form is user control but the answers have not solved my problem, or I have mis-understood them. Let me try explaining what I am doing more clearly. I have a page which displays a form to the user. The form is made of several sections, but for simplicity we'll say there are two. Each of these sections is a User Control, thus the

Efficient Custom Paging in ASP.NET 2.0 while sorting

老子叫甜甜 提交于 2019-12-11 11:53:00
问题 I've got an web app in ASP.NET 2.0 in which I need to do paging. My method of data access is to pull a DataSet out of a database call, then convert that to a List<Foo> (where Foo is my type I'm pulling out of the DB) and bind my GridView to it. My reason for this is that I didn't want to be having to use string indexers on DataTables all through my application, and that I could separate the display logic from the database by implementing display logic as properties on my classes. This also

The type initializer for '<Module>' threw an exception and Arithmetic operation resulted in an overflow

半腔热情 提交于 2019-12-11 11:35:36
问题 The same code runs in Windows 7 32 bit. But fails in windows 8 64 bit. Any ideas? Thanks 回答1: I just resolved it. This application requires 32-bit mode where as the IIS in my Windows 8 machine runs in 64-bit mode by default. I had to set Enable 32-bit Applications to true for the AppPool this application is using. and it was not failing on a specific line of code. The exception was thrown somewhere between Application_BeginRequest and Session_Start 来源: https://stackoverflow.com/questions

Do external references slow down my ASP.NET application? (VS: Add Reference dialog)

十年热恋 提交于 2019-12-11 06:44:42
问题 I've noticed as my website gets bigger and bigger, the time my laptop takes to display my page is much longer then say a new projects with minimal references. I think there are two variables at play that affect ASP.NET warm-up time: The quantity of external references The time it takes for a worker process to new() up each instance per worker process Additional time for the WCF objects as the ServiceHost may be in an external DLL First, are those the correct variables to take into account

FileUpload1.PostedFile.FileName is throwing exception

左心房为你撑大大i 提交于 2019-12-11 06:25:50
问题 I am using ASP.NET to read the data in the excel file. I am using a file upload control to read the file. I am able to read the data from the file in my local machine, but after deploying my code in the server, when I try to read the file from the client machine, I am getting an exception. FileUpload1.PostedFile.FileName is throwing the exception in the server. The exception message is: 'D:\path in client machine\MyExcel.xls' could not be found. Check the spelling of the file name, and verify

How to create friendly url's in asp.net 2

纵然是瞬间 提交于 2019-12-11 05:15:34
问题 I tried using the IHttpModule and managed to convert the urls just fine, but all of my images returned path error (all going through the new url directory). whats the solution? 回答1: You need to make sure that you use the "~/" path notation on your images and make sure that they are all server controls with runat='server'. Otherwise the images urls won't get rewritten. For example if you have a page that gets rewritten from: /Item/Bicycle.aspx to /Item.aspx?id=1234 Then what will happen is

How do I reference a component in an inline web service?

给你一囗甜甜゛ 提交于 2019-12-11 05:10:00
问题 I have a free hosting service that is stuck in ASP.NET 2.0. Additionally, it constrains users to only inline versions (no codebehind). However, it does allow references to custom components. I have built an inline .asmx and would, ideally, like to 'include'/'use' a component I've built. How do I do this inline? I've tried 'using [Namespace]', but get a compilation error. I've also tried using, in the WebMethod [Namespace of Component].[Method] as well. Again, this produces a compilation error