aspx getSessionId

VB.Net & Aspx No Comments (115 views)
Public Function getSessionId () As String
	return System.Web.HttpContext.Current.Session.SessionID
End Functio

XmlDocument

VB.Net & Aspx No Comments (104 views)
Dim myXmlDoc As XmlDocument = New XmlDocument()
'myXmlDoc.LoadXml(strXml) ' load from string
'myXmlDoc.Load(Server.MapPath("path/to/xml.xml"))
myXmlDoc.Load("http://domain/xml.xml")
Dim UserIdNode As XmlNodeList	=	myXmlDoc.GetElementsByTagName("UserId")
Dim FirstNameNode As XmlNodeList	=	myXmlDoc.GetElementsByTagName("FirstName")
 
Dim UserId As String	=	Convert.ToString(UserIdNode(0).InnerText)
Dim FirstName As String	=	Convert.ToString(FirstNameNode(0).InnerText)

Read the rest...

To enable/disable Just-In-Time debugging

VB.Net & Aspx No Comments (66 views)
  1. On the Tools menu, click Options.
  2. In the Options dialog box, select the Debugging folder.
  3. In the Debugging folder, select the Just-In-Time page.
  4. In the Enable Just-In-Time debugging of these types of code box, select or clear the relevant program types: Managed, Native, or Script.To disable Just-In-Time debugging, once it has been enabled, you must be running with Administrator privileges. Enabling Just-In-Time debugging sets a registry key, and Administrator privileges are required to change that key.
  5. Click OK.

WebClient

VB.Net & Aspx No Comments (117 views)
 
<%
Dim colParameter As New System.Collections.Specialized.NameValueCollection
colParameter.Add("a", "aaaaaaaaa")
colParameter.Add("b", "bbbbbbbbb")
 
Dim objClient As Net.WebClient = New System.Net.WebClient
Dim bytReponse As Byte() = objClient.UploadValues("http://domain.com/path/to/script", "POST",colParameter)
Dim strWebPage As String = Encoding.ASCII.GetChars(bytReponse)
 
Response.Write(strWebPage)
%>
 

วิธีแก้ไข Server Application Unavailable IIS + .NET Framework 2

VB.Net & Aspx No Comments (587 views)

สำหรับคนที่ใช้ IIS ทดสอบงานกับ .NET Framework 2 นั้นอาจจะต้องเจอปัญหาแบบนี้
เนื่องจาก IIS ยังไม่รู้จักกับ .NET Framework 2 ซึ่งขั้นตอนการแก้ไขก็เพียงแต่ทำให้ IIS รู้จักกับ .NET Framework 2 เท่านั้นเอง
Read the rest...

Page 1 of 11