एएसपी सामग्री प्रकार संपत्ति
❮ पूर्ण प्रतिक्रिया वस्तु संदर्भ
ContentType गुण प्रतिक्रिया ऑब्जेक्ट के लिए HTTP सामग्री प्रकार सेट करता है।
वाक्य - विन्यास
response.ContentType[=contenttype]
Parameter | Description |
---|---|
contenttype | A string describing the content type.
For a full list of content types, see your browser documentation or the HTTP specification. |
उदाहरण
यदि किसी ASP पृष्ठ में कोई ContentType गुण सेट नहीं है, तो डिफ़ॉल्ट सामग्री-प्रकार शीर्षलेख होगा:
content-type:text/html
कुछ अन्य सामान्य सामग्री प्रकार मान:
<%response.ContentType="text/HTML"%>
<%response.ContentType="image/GIF"%>
<%response.ContentType="image/JPEG"%>
<%response.ContentType="text/plain"%>
यह उदाहरण एक ब्राउज़र में एक एक्सेल स्प्रेडशीट खोलेगा (यदि उपयोगकर्ता के पास एक्सेल स्थापित है):
<%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>
❮ पूर्ण प्रतिक्रिया वस्तु संदर्भ