- embed resources
let’s start with the very basic if i tell you create the customize control (inherit the Textbox and create new Textbox MyTextBox) .
in other word you can create customize textbox with three condition
1) Upper Case : when user selected Upper Case all enter input converted into Upper Character.
2) Lower Case : when user selected Lower Case all enter input converted into Lower Character.
3) None : nothing to do.
now what can you do?
i am explain from my level.
1. i writen java script in the customize class.
2. i create java script and put that java script into my webapplication. i only written related function name in customize class.
above method is good but i face some problem which i explaining
in both of the case java script is readable i have to find that thing one java script easy to manage and second thing not readable.
now i m check that thing in to the embed resource application.
- Benifit Of embed resources :
1) manage all your dependencies into one single assembly like you identify the some stuff which are need in the application every time (like your company logo image,your company profile information).
1) create ClassLibrary Project In Visual Studio (Open –> File –> Project –> Class Library in C# Tag). give project Name : MyResource
2) Add Reference (go to Solution Explore –> Right Click On Reference –> select Add Reference).
2.1) select System.Web
3) change the Class Name MyTextBox
4) Inherite the TextBox Class in MyTextBox Class.
5) create Textbox which has different mode like when user select
1) upper then what ever they typed convered into upper
2) Lower then what ever they typed converted into lower
3) None nothing
now the main thing if you want to implement this then you want a create Java Script for this.
now add Java Script in to project.give a name MyJs.Js.
7) Add the Below Code in to MyTextBox Class.
8 ) now in the AssemblyInfo File Add the WebResource.
9) Now Build Project then Create WebApplication (asp.net using C#) or Add New web Site In Existing Project. here i added new web site in Existing project.
10) Add MyTextBox Dll Reference in to Newly Created WebSite.
11) Add MyTextBox In to WebPage. Set the property
12) Run Web Site And Check.
how to retriving resource (ImageFile,html file) from the embeding resource ?
1) Add Image In to your exiting Class Library Project (Image Name :MyImage.Jpg).
3) now in the AssemblyInfo File Add the WebResource.
4) Build the Project. and go to the WebSite Project.
5) in the web site project put the image control.
6) now in the page load event get the myimage from the dll file.
7) check code.
Now the interesting thing check the page source.