Scold Microsoft! Roar!
I started my website from JSP. Recently, my mentor asked me to use ASP. net to change a website, for Microsoft's a set of solutions, the heart is very uncomfortable, the most uncomfortable is that Microsoft wrapped their
The XMLHTTP object created using JavaScript submits a request to the ASP page, and the returned value may be garbled.
One solution is simple: Add response. charset = "gb2312" before the ASP return value ".Complete Code As follows: Html
test
Using system; using system. collections. generic; using system. web; using system. io; using system. text; /// /// summary description for netlog // public class netlog {// /// write the log to a text file // / /// action /// log content // /
Form top
Asp.net background code implementation click to dynamically Add a row of table
It can be implemented by session. I am working on a logistics system to increase the departure time of vehicles.
First, initialize session ["str"] = "";
This section describes the two objects of application and session from the perspective of program design.
· When loading asp dll and responding to the first request to an asp web page, create an application object. This object provides a storage
Books. asp
''Create an XML Object
Set objxmldom = server. Createobject ("Microsoft. xmldom ")
''Specifies whether the XML file download is asynchronous with the XML Processing
Objxmldom. async = false
''To get the Directory and file name of the XML
Simply paste ASP to create, open, write, and close files. Post a complete post later
Create a fileSet objfso = server. Createobject ("scripting. FileSystemObject") 'defines the component
Objfso. createtextfile (server. mappath ("/newfolder/New. asp")
Width = "80px" onafterpaste = "If (isnan (value) Execcommand ('undo ')">
In fact, the server control can also add events such as onkeydown and up.
In this way, only decimals and numbers can be entered.
In. NET development, to ensure data
We can put some configuration information in Web. xml and then read it through the corresponding functions. Asp.net provides a very convenient operation method. As follows:
Add the following content to the appsettings of Web. xml:View
Plain
. The core of Role-based security verification is the principal and identity objects. The principal is responsible for role or group verification, the identifier object encapsulates information about the user or entity being verified. Role security
Sample CodeProject requirements: You need to add a graphic verification code on the homepage logon interface. You can search for it on the Internet, especially if you find a few items. The main problem is that the width of images generated by most
2. Custom role providers
If you want to verify by role, it must involve the role provider. By default, it will connect to the default database, we can write a role provider to implement our own logic.First, add the configuration in Web.
When using DOM in ASP to create a new document, the new document will not be automatically indented. Although the new document is in a good format or valid format in terms of the document content, the entire document is on one line, when you open a
For a special reason, you need to restart a program on the server through the web page, that is, kill the program first, and then start again, because the permissions of Asp.net users are insufficient, if you directly kill the process, it will be
Public class vbwordapp
Private owordapplic as word. applicationclassPrivate odoc as word. DocumentPublic sub vbwordapp ()'Activate the com word InterfaceOwordapplic = new word. applicationclass
End sub
'Open a file (the file must exists) and
Obtain physical and virtual paths in ASP. NET
// Request. currentexecutionfilepath; the virtual path of the current request is in this format:/virtual directory name/admin/index. aspx// Request. applicationpath // obtain the root path of the virtual
Because the website needs to use FCKeditor to paging Long News and find it on the Internet, the solution is not clear and scattered, so you can change it yourself
First, modify the two JS files in FCKeditor \ editor \ JS \, fckeditorcode_gecko.js
In the past, writing programs never used caching (the level is too high). Fortunately, the website traffic was very small, so the performance problem was not prominent. However, if you do a formal project, regardless of the size, the cache
ASP full name Active Server Pages is a web server development environment that can generate and execute dynamic, interactive, and high-performance Web service applications. ASP uses the script language VBScript (Java Script) as its own development
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.