کامپوننت Content Linking ASP

مثال

کینٹنٹ لینکنگ کانپننٹ
اس مثال میں، ایک کینٹنٹ لیست قائم کی جائے گی。
کینٹنٹ لینکنگ کانپننٹ 2
اس مثال میں، کینٹنٹ لینکنگ کانپننٹ کا استعمال ایک فائل میں لیست کی گئی صفحات کے درمیان نیویگیشن کے لئے کیا جاتا ہے。

کامپوننت Content Linking ASP

ASP کینٹنٹ لینکنگ کانپننٹ، نئی لینکنگ سسٹم قائم کرنے کے لئے استعمال کیا جاتا ہے。

کینٹنٹ لینکنگ کانپننٹ، ایک نیکسٹ لینک اوبجیکٹ درآمد کرتا ہے، جس کا استعمال نیویگیشن کریجائے جانے والی صفحات کی لیسٹ کو رکھنے کے لئے کیا جاتا ہے。

قواعد

<%
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 introduction
asp_syntax.asp ASP syntax
asp_variables.asp ASP variables
asp_procedures.asp ASP program 

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

"nlcode.inc":

<%
'Use the Content Linking Component 
'to navigate 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")
%>

خروجی:}}

There are 4 items in the list

روش GetListIndex

بازگشت شماره شاخص فعلی فایل لیست پیوند محتوای. شماره شاخص اولین ورودی 1 است. اگر صفحه فعلی در فایل لیست وجود ندارد، 0 بازمی‌گرداند.

مثال

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetListIndex("links.txt") 
Response.Write("آئتمان نمبر ")
Response.Write(c)
%>

خروجی:}}

شماره آیتم 3

روش GetNextDescription

توضیحات متن بعدی در فایل لیست لینک‌های محتوایی لیست شده است. اگر فایل فعلی در لیست پیدا نشود، توضیحات متن آخرین صفحه لیست.

مثال

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetNextDescription("links.txt") 
Response.Write("Next ")
Response.Write("توضیحات است: ")
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 است: ")
Response.Write(c)
%>

خروجی: URL بعدی است: asp_variables.asp

روش GetNthDescription

توضیحات صفحه N در فایل لیست لینک‌های محتوایی لیست شده است.

مثال

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetNthDescription("links.txt",3) 
Response.Write("Third ")
Response.Write("توضیحات است: ")
Response.Write(c)
%>

خروجی: توضیحات سوم است: متغیرهای ASP

روش GetNthURL

URL در فایل لیست لینک‌های محتوایی لیست شده است که در صفحه N قرار دارد.

مثال

<%
dim nl,c
Set nl=Server.CreateObject("MSWC.NextLink") 
c=nl.GetNthURL("links.txt",3) 
Response.Write("Third ")
Response.Write("URL است: ")
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("توضیحات است: ")
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 است: ")
Response.Write(c)
%>

خروجی: URL قبلی: asp_variables.asp