ASP Content Linking कंपोनेंट

उदाहरण

Content Linking कंपोनेंट
इस उदाहरण में, एक सामग्री सूची बनाई जाएगी。
Content Linking कंपोनेंट 2
इस उदाहरण में, Content Linking कंपोनेंट का इस्तेमाल एक टेक्स्ट फ़ाइल में सूचीबद्ध पृष्ठों के बीच नेविगेशन के लिए किया जाता है。

ASP Content Linking कंपोनेंट

ASP Content Linking कंपोनेंट एक सहज और आसान नेविगेशन सिस्टम बनाने के लिए उपयोग किया जाता है。

Content Linking कंपोनेंट एक Nextlink ऑब्जैक्ट वापस करता है, जिसका इस्तेमाल नेविगेट करने वाले वेब पृष्ठों की सूची को रखने के लिए किया जाता है。

व्याकरण

<%
Set nl=Server.CreateObject( "MSWC.NextLink" )
%>

सबसे पहले, हम एक टेक्स्ट फ़ाइल - "links.txt" बनाएंगे। यह फ़ाइल नेविगेट करने वाले पृष्ठों के संबंधित जानकारी शामिल करती है। पृष्ठों की अनुक्रमणिका उनके प्रदर्शन क्रम के अनुसार होनी चाहिए और प्रत्येक फ़ाइल के वर्णन (फ़ाइल नाम और वर्णन जानकारी को टैब से अलग करके) शामिल होना चाहिए。

Note:If you want to add file information to the list or change the order of pages in the list, all you need to do is modify this text file! Then the navigation system will update automatically!

"links.txt":

asp_intro.asp ASP इंट्रो
asp_syntax.asp ASP सिंटेक्स
asp_variables.asp ASP वेरियेबल्स
asp_procedures.asp ASP प्रक्रियाएँ 

Please place this line of code in the listed pages above: <!-- #include file="nlcode.inc"--> This line of code will list each page referred to in "links.txt", so navigation can work.

"nlcode.inc":

<%
"Use the Content Linking Component 
"between the pages listed
"in links.txt
dim nl
Set nl=Server.CreateObject("MSWC.NextLink")
if (nl.GetListIndex("links.txt")>1) then
  Response.Write("<a href='" & nl.GetPreviousURL("links.txt"))
  Response.Write("'>पिछला पृष्ठ</a>")
end if
Response.Write("<a href='" & nl.GetNextURL("links.txt"))
Response.Write("'>अगला पृष्ठ</a>")
%>

ASP सामग्री लिंकिंग कम्पोनेंट की विधियाँ

GetListCount विधि

सामग्री संबंधित लिंक सूची फ़ाइल में सूचीबद्ध प्रोजेक्ट की संख्या रिटर्न करें

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetListCount("links.txt") 
Response.Write("There are ")
Response.Write(c)
Response.Write(" items in the list")
%>

आउटपुट:

सूची में 4 आइटम है

GetListIndex विधि

रिटर्न करें इस सामग्री संबंधित लिंक सूची फ़ाइल में वर्तमान फ़ाइल के संख्यापति को। पहले प्रविष्टि का संख्यापति 1 है। यदि वर्तमान पृष्ठ सूची फ़ाइल में नहीं है, तो 0 रिटर्न करें।

उदाहरण

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetListIndex("links.txt") 
Response.Write("Item number ")
Response.Write(c)
%>

आउटपुट:

आइटम संख्या 3

GetNextDescription विधि

इस विषय में लिंक सूची फ़ाइल में दिए गए अगले प्रविष्टि के लिए टेक्स्ट वर्णन लॉगदान करें। यदि सूची फ़ाइल में वर्तमान फ़ाइल नहीं मिलता, तो सूची में अंतिम पृष्ठ के लिए टेक्स्ट वर्णन。

उदाहरण

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetNextDescription("links.txt") 
Response.Write("Next ")
Response.Write("description is: ")
Response.Write(c)
%>

आउटपुट: अगला वर्णन है: ASP वेरियेबल्स

GetNextURL विधि

इस विषय में लिंक सूची फ़ाइल में दिए गए अगले प्रविष्टि का URL लॉगदान करें। यदि सूची फ़ाइल में वर्तमान फ़ाइल नहीं मिलता, तो सूची में अंतिम पृष्ठ का URL。

उदाहरण

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetNextURL("links.txt") 
Response.Write("Next ")
Response.Write("URL is: ")
Response.Write(c)
%>

आउटपुट: अगला URL है: asp_variables.asp

GetNthDescription विधि

इस विषय में लिंक सूची फ़ाइल में दिए गए नऊवीं पृष्ठ के लिए वर्णन जानकारी लॉगदान करें।

उदाहरण

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetNthDescription("links.txt",3) 
Response.Write("Third ")
Response.Write("description is: ")
Response.Write(c)
%>

आउटपुट: तीसरा वर्णन है: ASP वेरियेबल्स

GetNthURL विधि

इस विषय में लिंक सूची फ़ाइल में दिए गए नऊवीं पृष्ठ का URL लॉगदान करें।

उदाहरण

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetNthURL("links.txt",3) 
Response.Write("Third ")
Response.Write("URL is: ")
Response.Write(c)
%>

आउटपुट: तीसरा URL है: asp_variables.asp

GetPreviousDescription विधि

इस विषय में लिंक सूची फ़ाइल में दिए गए पूर्ववर्ती प्रविष्टि के लिए टेक्स्ट वर्णन लॉगदान करें। यदि सूची फ़ाइल में वर्तमान फ़ाइल नहीं मिलता, तो सूची में पहले पृष्ठ के लिए टेक्स्ट वर्णन。

उदाहरण

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetPreviousDescription("links.txt") 
Response.Write("Previous ")
Response.Write("description is: ")
Response.Write(c)
%>

आउटपुट: पूर्ववर्ती वर्णन है: ASP वेरियेबल्स

GetPreviousURL विधि

इस विषय में लिंक सूची फ़ाइल में दिए गए पूर्ववर्ती प्रविष्टि का URL लॉगदान करें। यदि सूची फ़ाइल में वर्तमान फ़ाइल नहीं मिलता, तो सूची में पहले पृष्ठ का URL。

उदाहरण

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetPreviousURL("links.txt") 
Response.Write("Previous ")
Response.Write("URL is: ")
Response.Write(c)
%>

आउटपुट: पिछला URL है: asp_variables.asp