![]() ![]() The application and its pages are instantiated and processed This should generate following result:ĪSP.Net processes pages to produce dynamic output Run the example either from Debug menu, or by pressing Ctrl-F5 or by right clicking on the design view and choosing ‘View in Browser’ from the popup menu. All you need to add is the Button1_Click routine, which is as follows: protected void Button1_Click(object sender, EventArgs e) The content file is automatically developed. Instead of typing the code, you can just drag the controls into the design view: Let us develop the same example using Visual Studio IDE. Open the file from the browser to run it and it should generate following result: Private void convertoupper(object sender, EventArgs e)Ĭopy this file to the web server’s root directory. The following code snippet provides a sample ASP.Net page explaining pafe directives, code section and page layout written in C#: It contains the server controls, text, inline JavaScript and HTML tags: The page layout provides the interface of the page. The page code could be precompiled and deployed in the form of a binary assembly. The code section or the code behind file provides all these event handler routines, and other functions used by the developer. How these events should be handled? That code is provided in the event handlers of the controls, which are nothing but functions bound to the controls. Now, these objects raises events when something happens on the user interface, like a user clicks a button or moves the cursor. We mentioned that, ASP.Net follows an object model. The code section provides the handlers for the page and control events along with other functions required. We will discuss all of these concepts in due time. It allows importing namespaces, loading assemblies and registering new controls with custom tag names and namespace prefixes. Page directives specify how the page should be processed, and which assumptions are to be taken about the page. ![]() The directive defines page-specific attributes used by the ASP.Net page parser and compiler. The page directives set up the environments for the page to run. It is modular in nature and can be divided into the following core sections: When a page is run an instance of the page object is created along with all its content controls.Īn ASP.Net page is also a server side file saved with the. An ASP.Net page is an object of the Page Class or inherited from it.Īll the controls on the pages are also objects of the related control class inherited from a parent Control class. Sensitive data from the page and the states of different controls on the page are stored in hidden fields and forms the context of that page request.ĪSP.Net runtime controls all association between a page instance and its state. Sau khi đã có MD5 fingerprint các bạn vào đây để Generate API Key.Ģ.An ASP.Net page is made of number of server controls along with the HTML controls, text and images. ![]() Debug keystore trên máy mình có đường dẫn như dưới đây, các bạn tự tìm trên máy của các bạn.Ĭ:\Documents and Settings\Administrator\.android\debug.keystoreīây giờ các bạn bật command line console lên và change directory tới thư mục chứa keystore và dùng jdk keytool để tạo MD5 fingerprint như hình dưới đây: Để có google mapapi key, ta cần phải tạo MD5 fingerprint, mình sẽ hướng dẫn các bạn tạo MD5 fingerprint với debugkeystore vì nó đã có sẵn nên ta bỏ qua bước tạo keystore cho đỡ loằng ngoằng mất thời gian. Trong file layout trên, các bạn chú ý cần đăng ký với google để lấy mapapi key. Trước hết để ứng dụng hoạt động được, các bạn cần khai báo những permissions sau trong file AndroidManifest.xml:Ī_COARSE_LOCATION Sau đây là phần code cho ứng dụng vừa mô tả. Dưới đâylà screenshot của màn hình hiển thị map trong ứng dụng (marker màu xanh giả lập vị trí hiện tại, các markers màu đỏ giả lập các vị trí cần tới)īạn chọn một vị trí trên bản đồ (marker màu đỏ) bằng cách chạm vào vị trí đó, ứng dụng sẽ tìm và vẽ đường từ vị trí hiện tại tới vị trí mà bạn vừa chọn (đường đi hiển thị bằng đường màu xanh lá cây) như hình sau: Trong bài đọc này mình sẽ giới thiệu với các bạn cách hiển thị map trên thiết bị Android và tìm đường từ vị trí hiện tại tới một vị trí khác cần đến. Đang rảnh rỗi nên ngồi thử viết lại và tìm hiểu thêm về cái Map trong Android. Tìm hiểu nguyên nhân mới biết rằng google không còn support KML direction data nữa. Ngày bắt đầu làm quen với lập trình Android, mình có viết một ứng liên quan đến Map, hôm nay lôi ra nghịch thử thấy nó không hoạt động nữa chẳng hiểu tại sao. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |