Class name space Pre-resource registration
Copy Code code as follows:
[Assembly:System.Web.UI.WebResource ("XXX.js.FilePlugin.js", "Text/javascript")]
OnPreRender Events
Resource Name
String _strresourcekey = ""; Resource Name
In the previous period of time to develop the site process, suddenly feel that this concise style and the overall style of the site does not mix, so look at the last generation of Aspnetpager HTML, wrote a section of CSS style, the style of
1. A potentially dangerous Request.Form value was detectedReason:(1) The ValidateRequest property is not properly set on the page or webconfig on which the data is submitted(2) HTML inside wrote two causeSolve:Scenario One: Add this sentence to the
LINQ Paging
Copy Code code as follows:
Testdatacontext dc = new Testdatacontext ();
public string Getpagenum (GridView gridviewname, int pagesize, iqueryable sql)
{
int page;
if (httpcontext.current.request.querystring["page"]!=
Share two ways of paging code
1. Use DataReader Paging
Copy Code code as follows:
PageList for DataReader
Public DataTable Pagelistreader (string connectionString, String sql, int pageSize, int curpage, out int
As the back-end optimization space is getting smaller, more and more sites pay more attention to the front-end performance optimization, is the browser, HTTP optimization, here to write two of the simplest and most effective ASP.net website
1, ClientIDModeRendering the ASP.net control automatically generates an ID that, when referenced in client script, creates a lot of trouble, although it is a simple concatenation of naming containers and IDs, but it still cannot predict the range of
Js:
Copy Code code as follows:
The function Save ()//saves a value that is not a server-side control
{
var 1= document.getelementbyid (' 1Box '). Value;
var 2 = document.getElementById (' 2Box '). Value;
var TxtValue = 1 + "" +
1. Start the restore below first look at the original paging stored procedures.
Copy Code code as follows:
ALTER PROCEDURE [dbo]. [Sp_sql_paging]
(
@SqlDataTable NVARCHAR (4000),--table name
@PrimaryKey NVARCHAR (4000),--primary Key
Request.params is actually a collection, which in turn includes Request.QueryString, Request.Form, Request.Cookies, and Request.ServerVariables.
If you want to pass data on two pages, you can only use Request.QueryString, Request.Form,
TextBox If you set Textmode= "MultiLine" the value of its maxlength setting is invalid; In order to achieve such as Tencent Meager, Sina meager such as the effect of the hint (Tencent and Sina meager text box should be used in the textarea), If you
//bound field
//implementation automatic numbering
Commonly used methods (these three best performance)
Other usage
//If the attribute is a string type do not use ToString ()
DataBinder.Eval usage Examples
The format string parameter is
Copy Code code as follows:
public class Bscookie
{
Cookie for Action
Private HttpCookie _thecookie;
The name of the corresponding cookie
private string _cookiename;
private bool _httponly = true;
Allow access only on server side,
See Discuz is 2 drop-down list to merge, the Internet to find some information, and then wrote this small source, here and you share!
Run the effect chart as shown below (dark places are not selected because that is the classification at the top
The following steps are explained:
1. The following modifications are made in the Global.asax document
Copy Code code as follows:
void Application_Start (object sender, EventArgs e)
{
Code that runs when the application starts
1. Class libraries that need to be referenced
Copy Code code as follows:
Using System.Net;
Using System.IO;
Using System.Text;
Using System.Text.RegularExpressions;
2. Access to other Web site content key code
Today in helping colleagues resolve the problem of Web References calls to WebService: when calling WebService first method Method1 Discovery server set-cookie:asp.net_sessionid=***** asp.net session state is saved. Then, when I call WebService's
①, when you are doing web development, you may also encounter problems that I have encountered before, when using a TextBox control, the edge of the control cannot be completely overwritten by the background picture, as shown in Figure 1:
Because
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service