|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: |
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.xml" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Dim cv As New ControlValues
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Clear()
Response.ContentType = "application/rss+xml"
Dim objX As New XmlTextWriter(Response.OutputStream, Encoding.UTF8)
objX.WriteStartDocument()
objX.WriteProcessingInstruction("xml-stylesheet", String.Format("title=""XSL_formatting"" type=""text/xsl"" href=""XSLTFile.xsl"""))
objX.WriteStartElement("rss")
objX.WriteAttributeString("version", "2.0")
objX.WriteStartElement("channel")
Dim res_string As String = String.Empty
Dim res_id As String = String.Empty
Dim res_type As String = String.Empty
If Not cv.check(Request.QueryString("id")) = "" Then
If cv.check(Request.QueryString("id")) = "News" Then
res_id = "41"
res_type = "new"
ElseIf cv.check(Request.QueryString("id")) = "Events" Then
res_id = "40"
res_type = "eve"
ElseIf cv.check(Request.QueryString("id")) = "Reports" Then
res_id = "47"
res_type = "rep"
ElseIf cv.check(Request.QueryString("id")) = "Links" Then
res_id = "48"
res_type = "web"
End If
res_string = "res_type='" & res_type & "'"
End If
Dim cmd As New SqlCommand("Select TOP 4 * From _resource where " & res_string & " and siteid=4 and active=1 ORDER BY res_id DESC", New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString))
cmd.Connection.Open()
Dim dataRdr As SqlDataReader = cmd.ExecuteReader()
objX.WriteElementString("title", " " & cv.check(Request.QueryString("id")) & " RSS Feed")
objX.WriteElementString("link", "http://localhost:3849/ new/")
objX.WriteElementString("description", "News Feed Description")
objX.WriteElementString("language", "en-us")
objX.WriteElementString("ttl", "60")
'objX.WriteElementString("image", "")
objX.WriteElementString("lastBuildDate", String.Format("{0:R}", DateTime.Now))
Do While dataRdr.Read()
objX.WriteStartElement("item")
objX.WriteElementString("title", dataRdr("res_title").ToString())
objX.WriteElementString("author", "")
objX.WriteElementString("link", "http://localhost:3849/ new/details.aspx?type=" & res_type & "&id=" & res_id & "")
objX.WriteStartElement("guid")
objX.WriteAttributeString("isPermaLink", "true")
objX.WriteString("http://localhost:3849/ new/details.aspx?type=" & res_type & "&id=" & res_id & "")
objX.WriteEndElement()
objX.WriteElementString("pubDate", String.Format("{0:R}", dataRdr("res_date")))
objX.WriteStartElement("category")
'objX.WriteString(dataRdr("lastname").ToString())
objX.WriteEndElement()
If dataRdr("res_description").ToString.Length > 97 Then
objX.WriteElementString("description", dataRdr("res_description").ToString().Substring(0, 97) & "...")
Else
objX.WriteElementString("description", dataRdr("res_description"))
End If
objX.WriteEndElement()
Loop
objX.WriteEndElement()
objX.WriteEndElement()
objX.WriteEndDocument()
objX.Flush()
objX.Close()
Response.End()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
styling:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Test</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>link</th>
</tr>
<xsl:for-each select="rss/channel/item">
<tr>
<td>
<xsl:value-of select="title"/>
</td>
<td>
<xsl:value-of select="link"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
|
Advertisement
| Hall of Fame |