ContentType

ASP ContentType xususiyati


❮ Response obyektining to‘liq ma’lumotnomasi

ContentType xususiyati Response obyekti uchun HTTP kontent turini belgilaydi.


Sintaksis

response.ContentType[=contenttype]

Parametr Tavsif
contenttype Kontent turini tavsiflovchi string.

Kontent turlarining to‘liq ro‘yxati uchun brauzeringiz hujjatlariga yoki HTTP spetsifikatsiyasiga qarang.


Misollar

Agar ASP sahifasida ContentType xususiyati o‘rnatilmagan bo‘lsa, standart content-type sarlavhasi quyidagicha bo‘ladi:

content-type:text/html

Boshqa ba’zi keng tarqalgan ContentType qiymatlari:

<%response.ContentType="text/HTML"%> <%response.ContentType="image/GIF"%> <%response.ContentType="image/JPEG"%> <%response.ContentType="text/plain"%>

Bu misol brauzerda Excel elektron jadvalini ochadi (agar foydalanuvchida Excel o‘rnatilgan bo‘lsa):

<%response.ContentType="application/vnd.ms-excel"%> <html> <body> <table> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> </tr> <tr> <td>5</td> <td>6</td> <td>7</td> <td>8</td> </tr> </table> </body> </html>


❮ Response obyektining to‘liq ma’lumotnomasi

W3Schools Pathfinder

Yutuqlaringizni kuzating – bu bepul!