The verification code is not displayed after the website is published

Source: Internet
Author: User

 

Solution:<% @ PageCodeFile = "***" Inherits = "***">
At this time,ASP.netYou need to findCodeFileFor dynamic compilation, but the above error is reported.

For development, that isLogic code of the pageCsWhen the file exists, there are no problems with the two writing methods.
<% @ Page Language = "C #" AutoEventWireup = "true"
Codebehind= "Index. aspx. cs" Inherits = "Community. IndexHomePage. index" %>

<% @ Page Language = "C #" AutoEventWireup = "true"CodeFile= "Index. aspx. cs" Inherits = "Community. IndexHomePage. index" %>

However, after the site is deployed, we will not deploy it.CsFile. At this time, the next method will report the error that the file cannot be found. Unless youCsOtherwise, a compilation error will be reported and the file cannot be found....

 

Inherits,CodeFile,CodeBehindDifference

650) this. width = 650; "style =" border-bottom: # ddd 1px solid; border-left: # ddd 1px solid; url (/e/u/lang/zh-cn/images/localimage.png) no-repeat center; border-top: # ddd 1px solid; border-right: # ddd 1px solid "src ="/e/u/themes/default/images/spacer.gif "width =" 554 "height =" 52 "word_img =" file: /// C: \ Users \ wpt \ AppData \ Local \ Temp \ msohtmlclip1 \ 01 \ clip_image001.png "/>

Inherits:(Inheritance)

MsdnExplanation: defines the code hiding class inherited from the page. It can be fromPageAny class derived from the class. This feature correspondsCodeFileFeature used together. The latter contains the source file path pointing to the Code hiding class.InheritsFeatures in useC #The Time Zone of the page language is case sensitive.IfInheritsFeatures do not contain namespaces,ASP. NETCheckClassNameWhether the feature contains a namespace.If it contains,ASP. NETWill try to useClassNameFeature namespace LoadingInheritsClass referenced in the feature.This assumptionInheritsFeatures andClassNameFeature uses the same namespace .)

InheritsAttribute is used to define the currentWebHidden code classes inherited by forms(This class isSystem. Web. UI. PageDerived class).
ThisInheritsAttribute is only used for writing in code hiding mode.WebForm, that is, if all your code is inWebForm
<Script runat = "server"> </script>
Label, you do not need to use this attribute.

CodeFile

MsdnDescription: Specifies the path of the code hidden file pointing to the page reference.This feature correspondsInheritsThis feature is used together to associate hidden source files with webpages.This feature is only valid for compiled pages.

This feature is used for website projects.

Codebehind

MsdnExplanation: specify the name of the compiled file that contains the class associated with the page.This feature cannot be used at runtime. This feature is usedWebApplication project.

CodebehindThe property is not reallyASP. NETAttribute, inASP. NETIt cannot be found in the document.
It is actually justVisual Studio. NETAttribute,
Visual Studio. NET
This attribute is used to track and manage projects.WebForm and the corresponding code hidden file,
For exampleWebWhen a server control is placed on the form,
Visual Studio. NET
TheWebThe code corresponding to the form hides the file and automatically inserts the relevant code.

 

 

This article is from the "HDDevTeam" blog and will not be reposted!

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.