SoFunction
Updated on 2025-03-07

Use custom tags, XML and XSL to display data in (C#)


public class Encoding
{
public string Encode(string cSource)
{
return (cSource);
}
}
public class EmList : Label
{
public override bool EnableViewState
{
get{ return false;}
}
public string XslFile{get;set;}
public object SerialObject{get;set;}
protected override void Render(HtmlTextWriter writer)
{
if (SerialObject == null)
{
throw new Exception("Object not initialized");
}
oSerial = new (());
oSb = new ();
oWr = new (oSb);
string Xml = "";
(oWr, SerialObject);
Xml =();
string cXslFileName = (XslFile);
if (!(cXslFileName))
{
throw new Exception("Please add your own exception handling program");
}
xslArgs = new ();
Encoding oEn = new Encoding();
("urn:Encoding", oEn);
oDoc = new ();
try
{
(Xml);
}
catch
{
throw new Exception("Please add your own exception handling program");
}
oTran = new ();
string cXsl = "";
try
{
cXsl = (cXslFileName);
}
catch
{
throw new Exception("Please add your own exception handling program");
}
oSr=new (cXsl);
oRe=(oSr);
try
{
(oRe);
}
catch
{
throw new Exception("Please add your own exception handling program");
}
try
{
(oDoc, xslArgs, writer);
}
catch
{
throw new Exception("Please add your own exception handling program");
}
}
}
public class PageBar :
{
public int PageNum{get;set;}
public int PageSize { get; set; }
public int PageCount { get; set; }
public string BaseUrl{get;set;}
protected override void Render(HtmlTextWriter writer)
{
(("<a href={0}?PageNum=1>First Page</a>|<a href={0}?PageNum={1}>Previous Page</a>|<a href={0}?PageNum={2}>Next Page</a>|<a href={0}?PageNum={3}>Last Page</a>&nbsp;&nbsp;(Total {4}Current Page{5})", BaseUrl, PageNum - 1 > 0 ? PageNum - 1 : 1, PageNum + 1 > PageCount ? PageCount : PageNum + 1, PageCount, PageCount, PageNum));
}
}