ASP ContentType गुण
ContentType गुण response ऑब्जैक्ट को HTTP सामग्री तरीके सेट करता है。
व्याकरण:
response.ContentType[=contenttype]
पारामीटर | वर्णन |
---|---|
contenttype |
Content-Type को वर्णित करने वाला शब्द पूर्ण Content-Type सूची प्राप्त करने के लिए आपके ब्राउज़र के दस्तावेज़ या HTTP नियमों को देखें。 |
उदाहरण
यदि ASP पृष्ठ ContentType गुण नहीं सेट किया गया है, तो डिफ़ॉल्ट content-type हेडर इस तरह है:
content-type:text/html
कुछ अन्य सामान्य ContentType मूल्य:
<%response.ContentType="text/HTML"%> <%response.ContentType="image/GIF"%> <%response.ContentType="image/JPEG"%> <%response.ContentType="text/plain"%> <%response.ContentType="image/JPEG"%>
इस उदाहरण ब्राउज़र में एक Excel इलेक्ट्रॉनिक टैबल खोलेगा (यदि उपयोगकर्ता Excel इंस्टॉल कर चुका है):
<%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>