ASP.NET Computer forum-Message page code


Computer forum-Message page code


<%@ Page Language="vb" AutoEventWireup="true" %>
<%@ Import Namespace ="System.Data" %>
<%@ Import Namespace ="System.Data.Oledb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" >
<head runat="server">
<style type="text/css">
height: 212px;
<form id="form1" runat="server">
<h4 style="background-color: #CCCFFF">Question:</h4>
<asp:TextBox ID="txtq" TextMode="MultiLine" runat ="server" Height="214px" Width="600px" />
<asp:Button ID="Submit" runat="server" Text="Add a Reply to this Question"
Width="194px" OnClick="Addreply"/>
<asp:Button ID="bntanswer" runat="server" Text="View Answers" Width="148px" OnClick="viewanswer" />

<script runat="server">

Dim cn As OleDb.OleDbConnection

Dim ds As New DataSet

Dim ad As OleDb.OleDbDataAdapter

Sub Page_Load

If Not Page.IsPostBack Then


End If

End Sub

Sub show(ByVal sender As Object, ByVal e As System.EventArgs)

cn = New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & MapPath("dbthreads.accdb"))


ad = New OleDb.OleDbDataAdapter("Select * From tblthread Where threadid=" & CInt(Request.QueryString("threadid")), cn)

ad.Fill(ds, "tblthread")

txtq.Text = ds.Tables(0).Rows(0)(4).ToString()


End Sub

Sub Addreply(ByVal sender As Object, ByVal e As System.EventArgs)

Response.Redirect("Reply.aspx?threadid=" & Request.QueryString("threadid"))

End Sub

Sub viewanswer()

Response.Redirect("Answers.aspx?threadid=" & Request.QueryString("threadid"))

End Sub





This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.