minority
10-31-2005, 01:34 PM
Hi I am trying to creat a script that brings in from an xml page. questionid, categoryid, question, answerid, answer.
but i am new to the asp.net business and need bit of help i have started a script but think i am totally wrong in what i am trying to do.
<%@ Import Namespace="System.Data" %>
<script runat="server">
sub Page_Load(sender as Object, e as EventArgs)
dim myknowledgebase=New DataSet
myknowledgebase.ReadXml(Server.MapPath("knowledgebase.xml"))
rb.DataSource=myknowledgebase
rb.QuestionID="QuestionID"
rb.CategoryID="CategoryID"
rb.Question="Question"
rb.AnswerID="AnswerID"
rb.Answer="Answer"
rb.DataBind()
end sub
Sub submit(sender As Object, e As EventArgs)
end sub
</script><html>
<body>
<form runat="server">
Enter your name:
<asp:TextBox id="txt1" runat="server" />
<asp:Button OnClick="submit" Text="Submit" runat="server" />
<p><asp:Label id="lbl1" runat="server" /></p>
</form></body>
</html>
i am currently getting the following errors
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30451: Name 'rb' is not declared.
Source Error:
Line 4: dim myknowledgebase=New DataSet
Line 5: myknowledgebase.ReadXml(Server.MapPath("knowledgebase.xml"))
Line 6: rb.DataSource=myknowledgebase
Line 7: rb.QuestionID="QuestionID"
Line 8: rb.CategoryID="CategoryID"
Source File: C:\Documents and Settings\paul\My Documents\website\index.aspx Line: 6
Basically i am hoping someone can tell me how to contect properly.
also i am not sure if to load the xml parts in first as the user needs to hit submit button before it searches so do i leave it until that happens or some how cache the data and then use it once they have searched.
your opinions would be great as well as any coding help links and books on the subject
thanks again
but i am new to the asp.net business and need bit of help i have started a script but think i am totally wrong in what i am trying to do.
<%@ Import Namespace="System.Data" %>
<script runat="server">
sub Page_Load(sender as Object, e as EventArgs)
dim myknowledgebase=New DataSet
myknowledgebase.ReadXml(Server.MapPath("knowledgebase.xml"))
rb.DataSource=myknowledgebase
rb.QuestionID="QuestionID"
rb.CategoryID="CategoryID"
rb.Question="Question"
rb.AnswerID="AnswerID"
rb.Answer="Answer"
rb.DataBind()
end sub
Sub submit(sender As Object, e As EventArgs)
end sub
</script><html>
<body>
<form runat="server">
Enter your name:
<asp:TextBox id="txt1" runat="server" />
<asp:Button OnClick="submit" Text="Submit" runat="server" />
<p><asp:Label id="lbl1" runat="server" /></p>
</form></body>
</html>
i am currently getting the following errors
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30451: Name 'rb' is not declared.
Source Error:
Line 4: dim myknowledgebase=New DataSet
Line 5: myknowledgebase.ReadXml(Server.MapPath("knowledgebase.xml"))
Line 6: rb.DataSource=myknowledgebase
Line 7: rb.QuestionID="QuestionID"
Line 8: rb.CategoryID="CategoryID"
Source File: C:\Documents and Settings\paul\My Documents\website\index.aspx Line: 6
Basically i am hoping someone can tell me how to contect properly.
also i am not sure if to load the xml parts in first as the user needs to hit submit button before it searches so do i leave it until that happens or some how cache the data and then use it once they have searched.
your opinions would be great as well as any coding help links and books on the subject
thanks again