AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

PROGRAM#- that tag issue with Web Site chatterbot development in c#
 
 

The PROGRAME# does not work properly with my web based chatterbot application.I am using the API in the code as follows:(This is my web page code behind in c#)

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AIMLbot;
using System.IO;

public 
partial class _Default System.Web.UI.Page
{
private Bot myBot;
private 
User myUser;
private 
Request lastRequest null;
private 
Result lastResult null;
protected 
void Page_Load(object senderEventArgs e)
{
this
.TextBox1.Focus();
myBot = new Bot();
myBot.loadSettings();
myUser = new User("DefaultUser"this.myBot);
AIMLbot.Utils.AIMLLoader loader = new AIMLbot.Utils.AIMLLoader(this.myBot);
this.myBot.isAcceptingUserInput false;
loader.loadAIML(@"E:\NEW NEW NEW FYP\VISCA\aiml");
this.myBot.isAcceptingUserInput true;
}
protected void Button1_Click(object senderEventArgs e)
{
if (this.myBot.isAcceptingUserInput)
{

string rawInput 
this.TextBox1.Text;
this.TextBox1.Text string.Empty;
this.Label1.Text += "You: " rawInput "<br><br>";
Request myRequest = new Request(rawInputthis.myUserthis.myBot);
Result myResult this.myBot.Chat(myRequest);
this.lastRequest myRequest;
this.lastResult myResult;
this.Label1.Text += "VISCA: " myResult.Output "<br><br>";

//this.TextBox1.Text = "";
//this.TextBox1.Focus();


}
}

And I had to copy and paste the config files in to “C:\Program Files\Microsoft Visual Studio 8\Common7\IDE” .And this code works perfectly with standalone application(all the tags are working).

The issue is with the web site development where some of the tags are not working specially the <that> tag is not working properly.

I guess some code is missing which gives the last bot output to the bot to process with the <that> tag.(The issue is normal standalone app works but the web site does not).My be a value is lost when web site post back or something.I did try many times and I could not find out where the error is.I guess some kind of a code is missing in the web site code behind or some other reason.

The PROGRAME# GUI can be downloaded form http://sourceforge.net/projects/aimlbot/files/

I will be grateful if anyone of you help me with your expert ideas on this matter.Thank you so much and help me plz.

p.s
——

I am unable to attach my test file here.I have uploaded it another forum http://forum.alicebot.org/viewtopic.php?f=3&t=38 .The attachment contains :

* test web site with the simple welcome.aiml file I am testing(AIMLbot.dll is referenced)
* and the config folder to be saved in the C:\Program Files\Microsoft Visual Studio 8\Common7\IDE. Path setting has some issues.

File Attachments
Test.rar  (File Size: 36KB - Downloads: 54)
 

 
  [ # 1 ]

@Umesha: Forum uploads: you’re now able to upload many of kind of attachments. Unfortunately, something tends to go wrong with .rar. Let me figure that out!

 

 
  [ # 2 ]

@Umesha: you can now upload .rar files (@your service grin )

 

 
  [ # 3 ]

wow that is great…now I can upload any type of files…specially .rar ones. Thanks so much.smile

And for those who will encounter the same problem as mine, I figured out a solution as well (at last) . smile

When we put the initialization statements in the page load event of the web page, what happen is for every post back to the site, this will get reinitialized.

Therefore first I thought of the solution as I need to make IsPostBack==false check for the page load statements.Then what happens is ; with post back with button clicks then page get refreshed but then no initializations.

Therefore the solution would be to use a view state.smile
But unfortunately AIMLbot did encounter some kind of a serialization issue.(which I could not figure out).But I guess if someone uses the view state it should also work correctly.

Then I simply tried out with session variables(given that the first initialization statements inside if(!IsPostBack) check) and now the <that> tag works perfectly.I assume this solution will be useful to anyone who did face with the same problem or anyone who will in the future, if by any chance they look at this post.
smilesmile

Thank you.

 

 
  login or register to react