Word Jumble In Mobile

Introduction

Hi, Something you never want to be away with. If you are a vocaboholic, then I am sure you will like this. Here is an application where you can play Word Jumble in Mobile. The only thing which I changed in this application is rather then using XML as a database I am using SQL Server, so if you want to run this application, you had to frame a table with three coloumns (Serial,Word,Jumble) that can make few entries and test this application.

And yes I had come out of people saying that, why the code behind this concept is not in Mobile Application. So here I implemented that, there is a file wordjumble.cs attached with it.

Do check your Session settings in the WAP Server. As you need to make it in the WAP Server (Here I am referring NOKIA).

So here it is, have fun with words right on MOVE !!!!!!!!!!!!!!

Here is the Code

Source Code

// wordjumble.aspx
<%@ Import Namespace="System"%>
<%@ Import
Namespace
="System.Data"%>
<%@ Import
Namespace
="System.Data.SqlClient"%>
<%@ Import
Namespace
="wordjumble"%>
<%@ Page
Inherits
="System.Web.UI.MobileControls.MobilePage" Language="C#" %>
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls"Assembly
="System.Web.Mobile"%>
<script runat="server" language="c#">
int i=1;
public string str;
public void Page_Load(Object sender,EventArgs e)
{
if(!IsPostBack)
{
wordjumble.wordjum wjm =
new wordjumble.wordjum();
SqlDataReader myReader;
myReader=wjm.wordload(i);
while(myReader.Read())
{
wordlist.Text=myReader["jumble"].ToString();
}
Session["id"] =++i;
}
}
public void SubmitBtn_Click(Object sender, EventArgs e)
{
wordjumble.wordjum wjm =
new wordjumble.wordjum();
SqlDataReader myReader;
myReader = wjm.wordcheck("select Word from WordJumble where
Jumble='"+wordlist.Text+"'");
while(myReader.Read())
{
str = myReader["Word"].ToString();
}
if((str.Trim().Equals(getword.Text)))
{
result.Text="hey u got it";
}
else
{
result.Text = "hi time yaar";
}
ActiveForm = SecondForm;
}
public void NextBtn_Click(Object sender, EventArgs e)
{
int j = (int)Session["id"];
wordjumble.wordjum wjm =
new wordjumble.wordjum();
SqlDataReader myReader;
myReader=wjm.wordload(j);
while(myReader.Read())
{
wordlist.Text=myReader["jumble"].ToString();
}
Session["id"]= ++j;
ActiveForm=FirstForm;
}
</script>
<Mobile:Form runat="server" id="FirstForm" BackColor="#336699"
ForeColor="#ffffff">
<Mobile:Label runat="server" Font-Name="Arial" Font-Size="Large"
ID="Label1">Word Jumble</Mobile:Label>
<
Mobile:Textbox runat="server" id="wordlist" />
<Mobile:TextBox runat="server" id="getword" />
<
Mobile:Command runat="server" OnClick="SubmitBtn_Click" Text="Go!"
ID="Command1"/>
<
Mobile:Command runat="server" OnClick="NextBtn_Click" Text="Next"ID="Command2"/>
<
Mobile:Label runat="server" id="Welcome" Font-Size="Large" />
</
Mobile:Form>
</Mobile:Form>


Similar Articles