???? ?? ????? ??? ?? ASP.NET 2.0

?????? ????????? ?????? ?????????
???? ???????: 910442 - ??? ???????? ???? ????? ????? ??? ???????.
???? ????? ??? ASP.NET

???? ?? ????? ??? ?? ASP.NET 2.0

?????? ??? ?????? ??? ?????????? ???? ?? ????? ??? ????? ?????? ??? ?????? ???? ????????? ???? ???? ?? ??? ??????? ?? ?????? ????? ??????? ??????? ???????? "??? ?????". ????? ????? ?????? ???????? ????????? ?????? ??? . ???? ???? ?????? ??? ??????? ?? ????? ?????? ?? ??? ??????.
????? ???? | ?? ????

?? ??? ??????

?????

?????! ???? ???? ??????? ???? ???? "???? ?????" ?? ???? ??? ASP.NET ?? Microsoft. ?? ?????? ??? ?????? ??? ??????? ????? ??????? ?? ? "????? ?????" ????? ?? ???????.

??? ??? ?????? ???? ???? ??? ???? ???? ?? COM ????? ????? ?? ??? ??? ?????? ?????? ?? ?????? ??? ???????? ???????? ???? ?? ??????? ????? ????? ????? ??????. ?????? ?? Microsoft ASP.NET 1.1? ??? ??? ???? ??? ????? ????? ??? ?????.html? css. ??????? ?????? ????? ?????? ??????? ?????? ???????? ???? ???? COM? ??? ???? ????? ????? ??? ??????? ?? COM ?????? ?????. ??? ????? ?? ?? ????? ???? ???? ?????? ?? ??????? ????? ??? ???? ??????. ?? ??? ??? ???? ??????? ?? ??? ?????? ????? ?? ?????????? ?? ?????? ?? ??? ????? ?? ????? ??? ??? ??????? ?? ???? ????? ?? ??? ??????? ??????? ???? ???? ?? ???? ???? ?????? ??? ???.

??? ??????? ?? Microsoft ASP.NET 2.0 ??? ?????? ??? ???????? ?? ???? ?????? ?????? ?????? ??? ??????? ?? ??????? ?.resources. ?????? ??? ??? ????? ?????? ????? ??? ??????? ????? ?? ???? ?????? ????????? ????????.

??? ???? "????? ?????"

????? ??? ????? ??? ????? ??? ???? WebResource.axd? ???? ?? ?????? ???????? ??????? ??????? ????? ??? ??????? ???. ??? ????? WebResource.axd ?? ????????????????????.

??? ??? ???? ?? ???? WebResource.axd? ???? ??????? ?? ???? "???? ???" ?? ????? QueryString ???? ??? . ???????? ??? ???? ???? "???? ???"? ????? ??????? ?? ????? ??????? ???? ????? ??? ??? ??????. ??? ??? ??? ??????? ??? ?????? ?? ????? ??????? ?? ??? ??????? ?????? ????? ?????? ?? ???????. ???????? ???? ??????? ??????? ??? ???????? ?? ?????? ???????? ??? ?????? ?? ??? ??????? ???? ????? ?? ??? ???????.

????? URL WebResource.axd ???? ?? ???:
WebResource.axd?d=SbXSD3uTnhYsK4gMD8fL84_mHPC5jJ7lfdnr1_WtsftZiUOZ6IXYG8QCXW86UizF0&t=632768953157700078
????? ???? ???? ????????? ??? ?? WebResource.axd?d=????? ????????? t =???? ???? ?????. ????? ???? "d" "???? ???" ????????. ?? "t" ?????? ?????? ??????? ???????? ???? ???? ?? ????? ?? ????? ?? ??? ???? ???? ?? ????????? ??????.

???? ?? ????????? ????????

?? ??????? ??? ???? ???? ???? COM ???? ?? ????????? ?? ??? ????? ??? ASP.NET ???? ??? ?????? ???????.

???? ???? COM "???? ???"

?????? ?????? "???? ???"? ???? ???? COM ???? ?????? (?????????????). ??? ??????? ??????? ???????:
  • ????? ????? ???? ??? ??????? smallFail.gif ????? ? ?????? ??? ??????? ?????? ???????? ???????? ?? smallSuccess.gif. ???? ?????? ???? ????????? ?? ????????? ???????? ????? ??????.
  • ??? HTML ???? ???? Help.htm. ??? ????? ??? ????? ????? ??? ??? ???? ???? ?? ??? ????? ????????.
  • ??? JavaScript ???? ???? MyScript.js. ??? ????? ????? ??? ??? ????????? ???????? JavaScript ???? ???? ???? ???? "???????" ?????? ??? ???? ??? ???? ???? ??? ???? ??? ???????.
  • ???.css ???? ???? MyStyleSheet.css. ??? ????? ??????? ???? ?? ?????? ?? ????? ??? ASP.NET.
?? ??? ???????? ??? ???? ??????? ???????? ?? ??? ????? ?????.
????? ????? ???
?????? ??? ???? ?????? ?? ?? ???? ??????? ??????? ???? ????? ??? "????? ???? ???? ???" ??? ??????? ?? Microsoft Visual Studio 2005 ??????? ???????. ?????? ??? ???????? ?? ?? ???? ???? ????? ??? ??????? ??? Visual Studio ?? ?? ?????? ????? ??? ??????? ??? ?? ??? ????? ????? ?????? ??? ???? ??????.

??? ?????? ????? ???? ???? ?????? ?????? ?? ?? ??? ??????? ??? ??????? ????? ????? ??????? ????? ?? ????? AssemblyInfo.cs ??? ?? ???? ?????.
[assembly: WebResource("SimpleControl.Help.htm", "text/html")]
[assembly: WebResource("SimpleControl.MyStyleSheet.css", "text/css")]
[assembly: WebResource("SimpleControl.smallFail.gif", "image/gif")]
[assembly: WebResource("SimpleControl.smallSuccess.gif", "image/gif")]
[assembly: WebResource("SimpleControl.MyScript.js", "text/javascript", PerformSubstitution = true)]

??? ??????? ???? ??? ????? ??? ?????? ??????? ??? ???:
  • ???? ???: ??? ???? ??????? ?? ???????
  • ??? ???????: MIME ??? ????? ??????
  • ?????????????????: ???? ?????? ???? ???? ?? ??? ???? "?????? Url ???? ???" ?????? ???? ??? ?????? ????? ?? ??? ?????? ??? ??????? ????????? ??????? ?????? ??????
??? ????? ???
?????? ??? "???? ???"? ???? ??????? ??????? ???????????????? ? ??? ????? ??? ?????????????????? ???? ??? ???????? ???? ?????? ??????? ?????? ?? ???? ??????. ??? ??????? ?????? ???? URL ??? ?????? ??????? ???? ??? ???? ?? ?????. ??????? ???????????????? ???? ??????? ???????:
  • ?????: ??? ?????? ???????
  • ??? ??????: ??? ?????? ???????
???????? ??? ???????? ????? ??? ???? ????? ???? ???? ?????????????????? ??????? ??? ??? ????? ??? ?? ???? ?????.
ClientScriptManager cs = Page.ClientScript;
            Type rsType = this.GetType();

??? ??? ???? ???? ?? ??? ?????? ?? ??? ???? ??????? ??? ????? ????? ???????? ???????? ??? ?? ???? ?????? ??? ?????? ????? ?? ?????? ????? ?????? ????? NavigateURL ??????? ??? ???? HTML ????.
HyperLink hlHelpFile = new HyperLink();
            hlHelpFile.NavigateUrl = cs.GetWebResourceUrl(rsType, "SimpleControl.Help.htm");
            hlHelpFile.Attributes.Add("onmouseover", "ChangeImage('image1','Red')");
            hlHelpFile.Attributes.Add("onmouseout", "RollbackImage('image1','Green')");
            
            this.Controls.Add(hlHelpFile);

            Image imgTest = new Image();
            imgTest.ImageUrl = cs.GetWebResourceUrl(rsType, "SimpleControl.smallFail.gif");
            imgTest.ID = "image1";
            hlHelpFile.Controls.Add(imgTest);

???? ?? ??? ????? ????????? ???????? ?????? ??? ?????? ?????? ?? ?????? ImageUrl ?? ?????? ??? ?????? ?????? ?? ?? ????.gif ????? ???? ????.
??????? ???? "???????"
???? ???? ????? ???????? "????? ?????" ?? ??????? ????????????????? ????? ???? ??? ??? ?? ???? ?? ?????? "??????? ????? ???" ?????. ???? ??? ?????? ?? ?????? ?????? ??? "????? ?????" ???? ??? ???? ????. ??? ?? ????? ??? ???????? ????? ????? ???? ??? ????? ??????? ??????? ???????? ???? ?????? ??? ??????? ???? ??? ?? ??????? ??????? ??? ??????? ??????.

?? ????????? ???????? ?????? ???? ????? ?? ???? ???? ???????? ??????? ?? ??? ?????? ???? ???? ??????????. ??? ?????? ?????????? ??????? ?? ??? ???????? ???. ?????? ?? ????????? ???????? ???? ???????? ?????.
function ChangeImage(imgControl,varcolor){
   document.getElementById(imgControl).src = '<%= WebResource("SimpleControl.smallSuccess.gif")%>';
    document.getElementById('Label1').style.color = varcolor;
}

function RollbackImage(imgControl, varcolor){
   document.getElementById(imgControl).src = '<%= WebResource("SimpleControl.smallFail.gif")%>';
   document.getElementById('Label1').style.color = varcolor;
}
??? ??? ???????? ????? ???? ???? MyScript.js ???? ???? ???? ?? ??? ???? ???? COM. ????? ?? ??? ???????? ??????? ????? ??????? ??? ??? ??????? ??????? ?? ???????? ????? ???.

????? ?????? ?? ?? ??? ????? ??? ????? JavaScript ?? ??????? ??? ?????? ??????? ?????????????????????????? ?? ????? ?????????????????? ??? ?? ???? ?????.
cs.RegisterClientScriptInclude("MyScript", cs.GetWebResourceUrl(rsType, "SimpleControl.MyScript.js"));

??????? ???? ?????? ?? ASP.NET

????? ????? ???? ???? COM ?????? ????? ??? ??????? ???? ?????? ??? ?? ????? ASP.NET ????. ?????? ????? ???? ?? ????? ???? ?????? ??? ???? ??????? ?? ASP.NET. ?? ????? ????? ???? ?????? ??? ?? ????? ??? ?? ??????.

??? ????? ???? ?????? ??? ???? ???????? ??? ????? ???? ?????? ?? ???? ????? ????????? ???????? ??????? ??? ????? ???? ??? HTML.
<cc1:MSButton ID="MSButton1" runat="server" strText="Problems?"></cc1:MSButton>
?? ???? ???? COM ????? ??? ??? ?? ???? ???? ?? ????? ?? ??? ???? ?????? ???? ?????? ?? ????? ASP.NET ????? ??. ?????? ??? ???? ??????? ???????? ??? ???? ????? ?????? HtmlControl ?? ???? HTML ?????? ??????? runatserver ??? ?? ???? ?????.
<link rel="Stylesheet"  id="lnkStyle" runat="server"  />
??? ???? ????? ??????? ????? ????? Href ?? ???? ?????? ??? ??????? ??? ??? ??????? ???? ??? ?? ??? Page_Load ??? ?? ???? ?????.
protected void Page_Load(object sender, EventArgs e)
    {
        //Get the name of the Web Resource.
        String rsname = "SimpleControl.MyStyleSheet.css";
        
        //Get the type of the class.
        Type rstype = typeof(SimpleControl.MSButton);

        // Get a ClientScriptManager reference from the Page class.
        ClientScriptManager cs = Page.ClientScript;
        lnkStyle.Href = cs.GetWebResourceUrl(rstype, rsname);
     }

??? ????? ????????? ????????? ??? ??? ???? ???? ???? ???? ?????? ???:
?? ??? ??????????? ??? ??????
 ??? ????
???? ?????? ??? ???? ?????? ????? ??? ???:
?? ??? ??????????? ??? ??????
 ???? ?????
??? ????? ??? ??? ????????? ???? ??? ????? ??? ???? ?????????? ???? ???? ?? ??? ??????? ???? ???? COM.

???????

????? ??? ???? ????? ????? ?? ASP.NET 2.0. ????? ??????? ??? ?????? ?????? ??? ??????? ?????. ?????? ?? ?????? ??????? ?????? ?? ????????? ?????? ?? ?? "????? ?????" ?? ???? ??? ???? ???????.

?? ASP.NET 2.0? WebResource.axd ??? ????????? ?????? ?????? Microsoft.NET Framework ???????? ??????? ???????. ??? ???? ??????? ??????.NET framework WebResource.axd ???????? ???????? ????? WebUIValidation.js ????? ???? ??? ???????? ?????? ?? ??? ????? ?????? ???????? ??? ???????? ????? Menu.js ????? ??????? .

?????

????? ?? ?????????? ?????? ????? ????? Microsoft ???????? ??? ?????:
????? ClientScriptManager.GetWebResourceUrl
http://msdn2.microsoft.com/en-us/library(d=robot)/system.web.ui.clientscriptmanager.getwebresourceurl.aspx

????? ?????????????????
http://msdn2.microsoft.com/en-us/library(d=robot)/system.web.ui.webresourceattribute.aspx

???????? ????????? ???????? ???????
http://msdn2.microsoft.com/en-us/library/ht9h2dk8.aspx
??? ?? ????? ??????? ?? ????? ?? ????? ????? ??? ???????? ???? ?????? ????? ?? ??????? ?????????? ?? ?? ????? ??????? ???????? ?????? ??? .

???????

???? ???????: 910442 - ????? ??? ??????: 20/????? ???????/1434 - ??????: 3.0
????? ???
  • Microsoft ASP.NET 2.0
????? ??????: 
kbhowto kbasp kbmt KB910442 KbMtar
????? ????
???: ??? ????? ??? ??????? ???????? ????? ?????????? ??????? ?????? ??? ??????? ?? ??? ??????? ?? ??????? ??? ??? ?? ???? ????????? ???? ??????? ???????(CTF) ?? ?? ???? ????? ????. ???? ?? ???? ?????????? ??? ???????? ???????? ???? ??? ?? ???????? ??????? ?? ??? ??????? ???????? ?? ??? ??????? ??????? ??? ?????? ?? ?????? ??? ???? ???????? ???????? ?? ????? ??????? ????? ????? ??????. ??? ?? ???????? ???????? ?? ????? ??? ????? ?? ???????? ?? ???? ????? ?? ?????. ?????? ??? ???? ?????????? ???? ?????? ?? ??? ????? ?? ??? ??? ?? ??????? ?? ??? ????? ?? ???? ????? ????? ?? ????? ??????? ???? ?? ???????? ?? ??? ???????.
???? ??? ????? ??????? ?????? ??????????910442
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com