random number linked with imageshttp://forums.asp.net/t/1367029.aspx/1?random+number+linked+with+imagesWed, 15 Apr 2009 18:02:40 -040013670292844009http://forums.asp.net/p/1367029/2844009.aspx/1?random+number+linked+with+imagesrandom number linked with images <p>Hey,</p> <p>I am building a lottery website and have generated random numbers between 1-49. Each sets of numbers have a specific colour, the code i have used is shown below:-</p> <blockquote><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">protected</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">void</font></font><font size="2"> Button1_Click(</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">object</font></font><font size="2"> sender, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">EventArgs</font></font><font size="2"> e)</font><font size="2"> <p>{</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">int</font></font><font size="2">[] num = </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">int</font></font><font size="2">[6];</font><font size="2"> <p></font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Random</font></font><font size="2"> RandomClass = </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Random</font></font><font size="2">();</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">do</p> </font></font><font size="2"> <p>{</p> <p>num[0] = RandomClass.Next(1, 50);</p> <p>num[1] = RandomClass.Next(1, 50);</p> <p>num[2] = RandomClass.Next(1, 50);</p> <p>num[3] = RandomClass.Next(1, 50);</p> <p>num[4] = RandomClass.Next(1, 50);</p> <p>num[5] = RandomClass.Next(1, 50);</p> <p>}</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">while</p> </font></font><font size="2"> <p>(num[0] == num[1] || num[0] == num[2] || num[0] == num[3] || num[0] == num[4] || num[0] == num[5] ||</p> <p>num[1] == num[2] || num[1] == num[3] || num[1] == num[4] || num[1] == num[5] ||</p> <p>num[2] == num[3] || num[2] == num[4] || num[2] == num[5] ||</p> <p>num[3] == num[4] || num[3] == num[5] ||</p> <p>num[4] == num[5]);</p> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Array</font></font><font size="2">.Sort(num);</font><font size="2"> <p>&nbsp;</p> txt_b1.Text = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Convert</font></font><font size="2">.ToString(num[0]);</font><font size="2"> <p>txt_b2.Text = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Convert</font></font><font size="2">.ToString(num[1]);</p> txt_b3.Text = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Convert</font></font><font size="2">.ToString(num[2]);</font><font size="2"> <p>txt_b4.Text = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Convert</font></font><font size="2">.ToString(num[3]);</p> txt_b5.Text = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Convert</font></font><font size="2">.ToString(num[4]);</font><font size="2">txt_b6.Text = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Convert</font></font><font size="2">.ToString(num[5]);</font><font size="2"> <p>numbercolour(txt_b1, num[0]);</p> <p>numbercolour(txt_b2, num[1]);</p> <p>numbercolour(txt_b3, num[2]);</p> <p>numbercolour(txt_b4, num[3]);</p> <p>numbercolour(txt_b5, num[4]);</p> <p>numbercolour(txt_b6, num[5]);</p> <p>}</p> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">private</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">void</font></font><font size="2"> numbercolour(</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">TextBox</font></font><font size="2"> numbers, </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">int</font></font><font size="2"> hello)</font><font size="2"> <p>{</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (hello &lt; 10)</font><font size="2"> <p>numbers.BackColor = System.Drawing.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Color</font></font><font size="2">.White;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">else</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (hello &lt; 20)</font><font size="2"> <p>numbers.BackColor = System.Drawing.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Color</font></font><font size="2">.Blue;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">else</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (hello &lt; 30)</font><font size="2"> <p>numbers.BackColor = System.Drawing.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Color</font></font><font size="2">.Pink;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">else</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (hello &lt; 40)</font><font size="2"> <p>numbers.BackColor = System.Drawing.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Color</font></font><font size="2">.Green;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">else</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (hello &lt; 50)</font><font size="2">numbers.BackColor = System.Drawing.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Color</font></font><font size="2">.Yellow;</font><font size="2"> <p>}</p> </blockquote> <p>&nbsp;Upon doing this i insert the values of the text boxes into a database using the following code:-</p> <blockquote><font color="#0000ff" size="2"><font color="#0000ff" size="2">string</font></font><font size="2"> conString = </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;Provider=Microsoft.Jet.OleDb.4.0;&quot;</font></font><font size="2"> &#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;Data Source=|DataDirectory|star_lottery.mdb;&quot;</font></font><font size="2">;</font></font><font size="2"> <p></font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbConnection</font></font><font size="2"> empConnection = </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbConnection</font></font><font size="2">(conString);</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">string</font></font><font size="2"> insertStatement = </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;INSERT INTO syndicate_members &quot;</p> </font></font><font size="2"> <p>&#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;([mem_name], [mem_id], [syn_id], [num1], [num2], [num3], [num4], [num5], [num6])&quot;</p> </font></font><font size="2">&#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;VALUES (@mem_name, @mem_id, @syn_id, @num1, @num2, @num3, @num4, @num5, @num6)&quot;</font></font><font size="2">;</font><font size="2"> <p></font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbCommand</font></font><font size="2"> insertCommand = </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbCommand</font></font><font size="2">(insertStatement, empConnection);</p> insertCommand.Parameters.Add(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;@mem_name&quot;</font></font><font size="2">, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbType</font></font><font size="2">.Char).Value = txt_name.Text;</font><font size="2"> <p>insertCommand.Parameters.Add(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;@mem_id&quot;</font></font><font size="2">, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbType</font></font><font size="2">.Char).Value = Session[</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;mem_id&quot;</font></font><font size="2">];</p> insertCommand.Parameters.Add(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;@syn_id&quot;</font></font><font size="2">, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbType</font></font><font size="2">.Char).Value = Session[</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;syn_id&quot;</font></font><font size="2">];</font><font size="2"> <p>insertCommand.Parameters.Add(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;@num1&quot;</font></font><font size="2">, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbType</font></font><font size="2">.Char).Value = txt_b1.Text;</p> insertCommand.Parameters.Add(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;@num2&quot;</font></font><font size="2">, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbType</font></font><font size="2">.Char).Value = txt_b2.Text;</font><font size="2"> <p>insertCommand.Parameters.Add(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;@num3&quot;</font></font><font size="2">, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbType</font></font><font size="2">.Char).Value = txt_b3.Text;</p> insertCommand.Parameters.Add(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;@num4&quot;</font></font><font size="2">, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbType</font></font><font size="2">.Char).Value = txt_b4.Text;</font><font size="2"> <p>insertCommand.Parameters.Add(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;@num5&quot;</font></font><font size="2">, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbType</font></font><font size="2">.Char).Value = txt_b5.Text;</p> insertCommand.Parameters.Add(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;@num6&quot;</font></font><font size="2">, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbType</font></font><font size="2">.Char).Value = txt_b6.Text;</font><font size="2"> <p>empConnection.Open();</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">try</p> </font></font><font size="2"> <p>{</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">int</font></font><font size="2"> count = insertCommand.ExecuteNonQuery();</font><font size="2">Response.Redirect(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;mysyndicates_add.aspx&quot;</font></font><font size="2">);</font><font size="2"> <p>}</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">catch</font></font><font size="2"> (</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">OleDbException</font></font><font size="2"> ex)</font><font size="2"> <p>{</p> Label10.Text = </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;&lt;b style=color:red&gt;Error, Try Again&lt;/b&gt;&quot;</font></font><font size="2">;</font><font size="2"> <p>}</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">finally</p> </font></font><font size="2"> <p>{</p> <p>empConnection.Close();</p> <p>}</p> </blockquote> <p>HOWEVER..i have created 49 images of lottery balls in Photoshop linking with the colour of each ball number according to my code. What i want to do is when the random button is clicked, pull out the speicific image of the ball. so for example if i click on random and it displays the numbers 4,12,34,35,7, and 9 it will display the images of the balls i have if you know what i mean..? Then i want to insert the information into a database. So basically using exactly the same concept i have used here but instead of a text box i want to firstly display the relevant image of the ball when the random button is clicked, then i want to add the value into a database.</p> <p>Any ideas? Sorry for the confusion</p> <p>Thank You</p> <p>Kind Regards [:)]</p> </font> 2009-01-03T05:02:03-05:002844349http://forums.asp.net/p/1367029/2844349.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>I assume you named those images in this manner: 1.jpg, 2.jpg, 3.jpg... and you saved them in &quot;images&quot; folder.<br> If that's the case, you can achieve your goal with this DataList:</p> <blockquote><span class="icon-blockquote"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:DataList ID=&quot;DataList1&quot; runat=&quot;server&quot; CellPadding=&quot;5&quot; CellSpacing=&quot;5&quot; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RepeatColumns=&quot;6&quot;&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ItemStyle HorizontalAlign=&quot;Center&quot; /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ItemTemplate&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:Image ID=&quot;Image1&quot; runat=&quot;server&quot; ImageUrl='&lt;%# string.Format(&quot;~/images/{0}.jpg&quot;, Container.DataItem) %&gt;' /&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ItemTemplate&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/asp:DataList&gt;</blockquote> and modify your code a bit(I made it simplier, you just need to add database inserting funcionality): <blockquote><span class="icon-blockquote"></span>&nbsp;&nbsp;&nbsp; protected void Button1_Click(object sender, EventArgs e)<br> &nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int[] num = new int[6];<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Random RandomClass = new Random();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ArrayList nums = new ArrayList();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 1; i &lt; 50; i&#43;&#43;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nums.Add(i);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; 6; i&#43;&#43;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; num[i] = (int)nums[RandomClass.Next(1, 49 - i)];<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nums.Remove(num[i]);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataList1.DataSource = num;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataList1.DataBind();<br> &nbsp;&nbsp;&nbsp; }</blockquote> <p></p> 2009-01-03T10:42:35-05:002846239http://forums.asp.net/p/1367029/2846239.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>Hey,</p> <p>&nbsp;Thanks for a great reply, it worked perfectly. The only annoying thing was that all 49 images were made one by one!!</p> <p>I have another question... once i click on random and it displays the images of the balls, how can i insert that value in the text boxes, so then i can insert the numbers into the database.</p> <p>&nbsp;For example i have enabled users to put their desired numbers in manually or randomly, so if they do not put it manually, once random is clicked it shows the random ball images, AND puts the numbers into the textboxes...</p> <p>my code now looks like so:</p> <blockquote><font size="2"></font> <p><font color="#0000ff" size="2"><font color="#0000ff" size="2"></p> </font></font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">table</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">cellspacing</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;5&quot;&gt;</font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">tr</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Label1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Player Name&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p>&nbsp;</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Label2&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Ball 1&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Label3&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Ball 2&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Label4&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Ball 3&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Label5&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Ball 4&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Label6&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Ball 5&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Label7&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Ball 6&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">tr</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p>&nbsp;</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">tr</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_name&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</font></font><font size="2"> </font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RequiredFieldValidator</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;RequiredFieldValidator8&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </p> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ErrorMessage</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;*&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ControlToValidate</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_name&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RequiredFieldValidator</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</font></font><font size="2"> </font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Width</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;29px&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"></font><font size="2"></font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b2&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Width</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;29px&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</font></font><font size="2"></font> <font size="2"></font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b3&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Width</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;29px&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</font></font><font size="2"></font> <font size="2"></font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b4&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Width</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;29px&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</font></font><font size="2"></font> <font size="2"></font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b5&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Width</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;29px&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</font></font><font size="2"></font> <font size="2"></font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b6&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Width</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;29px&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">TextBox</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</font></font> <font size="2"></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Button</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Button1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Random&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">onclick</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Button1_Click&quot;</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">/&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">tr</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p>&nbsp;</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">tr</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;RangeValidator1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ErrorMessage</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Invalid&quot;</font></font><font size="2"> </font><font size="2"> <p></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ControlToValidate</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MaximumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;49&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MinimumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Type</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Integer&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;RangeValidator2&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ErrorMessage</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Invalid&quot;</font></font><font size="2"> </font><font size="2"> <p></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ControlToValidate</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b2&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MaximumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;49&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MinimumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Type</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Integer&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;RangeValidator3&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ErrorMessage</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Invalid&quot;</font></font><font size="2"> </font><font size="2"> <p></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ControlToValidate</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b3&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MaximumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;49&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MinimumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Type</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Integer&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;RangeValidator4&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ErrorMessage</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Invalid&quot;</font></font><font size="2"> </font><font size="2"> <p></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ControlToValidate</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b4&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MaximumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;49&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MinimumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Type</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Integer&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;RangeValidator5&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ErrorMessage</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Invalid&quot;</font></font><font size="2"> </font><font size="2"> <p></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ControlToValidate</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b5&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MaximumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;49&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MinimumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Type</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Integer&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;RangeValidator6&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ErrorMessage</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Invalid&quot;</font></font><font size="2"> </font><font size="2"> <p></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ControlToValidate</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;txt_b6&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MaximumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;49&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">MinimumValue</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Type</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Integer&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">RangeValidator</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">tr</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">table</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p>&nbsp;</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">table</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">cellspacing</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;5&quot;&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">tr</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Button</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Button3&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Add &amp; Continue&quot;</font></font><font size="2"> </font><font size="2"> <p></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">onclick</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Button3_Click&quot;</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">/&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Button</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Button2&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Add &amp; Finish&quot;</font></font><font size="2"> </font><font size="2"> <p></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">onclick</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Button2_Click&quot;</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">/&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Button</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Button4&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Test&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">onclick</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Button4_Click&quot;</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">/&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Label10&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">Text</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;&quot;&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Label</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">td</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">tr</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">table</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p>&nbsp;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">DataList</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;DataList1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">CellPadding</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;5&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">CellSpacing</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;5&quot;</font></font><font size="2"> </font><font size="2"> <p></font><font color="#ff0000" size="2"><font color="#ff0000" size="2">RepeatColumns</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;6&quot;&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">ItemStyle</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">HorizontalAlign</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Center&quot;</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">/&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">ItemTemplate</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">Image</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ID</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;Image1&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">runat</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">=&quot;server&quot;</font></font><font size="2"> </font><font color="#ff0000" size="2"><font color="#ff0000" size="2">ImageUrl</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">='</font></font><font size="2">&lt;%# string.Format(&quot;~/balls/{0}.jpg&quot;, Container.DataItem) %&gt;</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">'</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">/&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">ItemTemplate</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</p> </font></font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&lt;/</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">asp</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">:</font></font><font color="#a31515" size="2"><font color="#a31515" size="2">DataList</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">&gt;</font></font><font color="#0000ff" size="2"><font color="#0000ff" size="2"></p> </blockquote> </font></font> <p>&nbsp;Thank You again.</p> <p>Regards</p> 2009-01-05T00:39:08-05:002846742http://forums.asp.net/p/1367029/2846742.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>You can use your own code:</p> <blockquote><span class="icon-blockquote"></span>&nbsp;&nbsp;&nbsp; protected void Button1_Click(object sender, EventArgs e)<br> &nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int[] num = new int[6];<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Random RandomClass = new Random();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ArrayList nums = new ArrayList();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 1; i &lt; 50; i&#43;&#43;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nums.Add(i);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; 6; i&#43;&#43;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; num[i] = (int)nums[RandomClass.Next(1, 49 - i)];<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nums.Remove(num[i]);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataList1.DataSource = num;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataList1.DataBind();<br> <strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txt_b1.Text = Convert.ToString(num[0]); <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txt_b2.Text = Convert.ToString(num[1]);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txt_b3.Text = Convert.ToString(num[2]); <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txt_b4.Text = Convert.ToString(num[3]);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txt_b5.Text = Convert.ToString(num[4]);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; txt_b6.Text = Convert.ToString(num[5]);</strong><br> &nbsp;&nbsp;&nbsp; }</blockquote> <p></p> 2009-01-05T06:46:02-05:002847379http://forums.asp.net/p/1367029/2847379.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>[:D]&nbsp; Thank You, your a legend! I now have one final question sorry...</p> <p>I want to retrieve the winning lottery numbers from the national lottery website from the following RSS feed:-</p> <blockquote> <p>http://www.schok.co.uk/lottery/lottery.xml</p> </blockquote> <p>I have the following code so far:</p> <blockquote> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:XmlDataSource ID=&quot;XmlDataSource1&quot; runat=&quot;server&quot; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataFile=&quot;http://www.schok.co.uk/lottery/lottery.xml&quot; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XPath=&quot;rss/channel/item[position()&amp;lt;=1]&quot;&gt;&lt;/asp:XmlDataSource&gt;</p> </blockquote> <p>However what i want to do is ONLY select the winning numbers and not the other text. I want to use the first feed which will say something on the lines of:-</p> <blockquote> <p>The Main UK Lottery Draw Numbers for 03-01-2009<br> 05 January 2009 02:00<br> Draw date&nbsp; 03-01-2009 Draw numbers are&nbsp; 39 ,&nbsp; 37 ,&nbsp; 19 ,&nbsp; 49 ,&nbsp; 9&nbsp; and&nbsp; 36&nbsp; - The bonus ball is&nbsp; 10 , Ball set&nbsp; 6 , Draw machine is&nbsp; TOPAZ</p> </blockquote> <p>I want to select JUST the numbers and then check them against a database of numbers which users have entered numbers into. I have done some research and the best way seems to be parse string using string.split..? but i really dont know where to begin.</p> <p>Thank You&nbsp;</p> <p>Sorry for all the questions</p> <p>Kind Regards <br> </p> <blockquote> <p>&nbsp;</p> </blockquote> 2009-01-05T12:05:09-05:002847693http://forums.asp.net/p/1367029/2847693.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>You can try with this code (this example is done with LINQ, so you'll have to use ASP.NET 3.5):</p> <blockquote><span class="icon-blockquote"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XElement xEl = XElement.Load(&quot;http://www.schok.co.uk/lottery/lottery.xml&quot;);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CultureInfo info = new CultureInfo(&quot;en-US&quot;);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var lastDraw = (from p in xEl.Descendants(&quot;item&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; orderby DateTime.ParseExact(p.Element(&quot;pubDate&quot;).Value.Substring(5, 20), &quot;dd MMM yyyy HH:mm:ss&quot;, info) descending<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select p.Element(&quot;description&quot;).Value).FirstOrDefault();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (lastDraw != null)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string[] lastDrawLetters = lastDraw.Split(' ');<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ArrayList nums = new ArrayList();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; lastDrawLetters.Count(); i&#43;&#43;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double j = 0;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (double.TryParse(lastDrawLetters[i], out j))<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nums.Add(j);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //This line is just for testing:<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.Write(j &#43; &quot;&lt;br/&gt;&quot;);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</blockquote> <p></p> 2009-01-05T14:40:30-05:002847706http://forums.asp.net/p/1367029/2847706.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>Cheers, would i need to add a namespace at the top?</p> <p>I am getting the following errors:-</p> <blockquote> <p><strong>Error&nbsp;2&nbsp;The type or namespace name 'CultureInfo' could not be found (are you missing a using directive or an assembly reference?)</strong>&nbsp;</p> <p><strong>Error&nbsp;5&nbsp;Argument '2': cannot convert from 'lambda expression' to 'System.Func&lt;System.Xml.Linq.XElement,System.DateTime&gt;</strong></p> <p><strong>Error&nbsp;4&nbsp;'System.Collections.Generic.IEnumerable&lt;System.Xml.Linq.XElement&gt;' does not contain a definition for 'OrderByDescending' and the best extension method overload 'System.Linq.Enumerable.OrderByDescending&lt;TSource,TKey&gt;(System.Collections.Generic.IEnumerable&lt;TSource&gt;, System.Func&lt;TSource,TKey&gt;)' has some invalid arguments</strong><br> <br> </p> </blockquote> 2009-01-05T14:48:21-05:002847722http://forums.asp.net/p/1367029/2847722.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>Yes, you'll need the following:</p> <blockquote><span class="icon-blockquote"></span>using System.Linq;<br> using System.Xml.Linq;<br> using System.Globalization;<br> using System.Collections;</blockquote> <p></p> 2009-01-05T15:02:18-05:002848473http://forums.asp.net/p/1367029/2848473.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>Hey,</p> <p>It is working but it is getting the wrong RSS feed...</p> <p>the one i need is </p> <blockquote> <p><a class="__feedview__feedItemUnreadTitleLink" href="http://www.schok.co.uk/lottery/the-national-lottery-draw-numbers.php"><font color="#3165c6">The Main UK Lottery Draw Numbers for 03-01-2009</font></a></p> </blockquote> <p class="__feedview__feedItemTitle">however it is now showing</p> <blockquote> <p class="__feedview__feedItemTitle"><a class="__feedview__feedItemUnreadTitleLink" href="http://www.schok.co.uk/lottery/daily-play.php"><font color="#3165c6">Daily play lottery Results for 03-01-2009</font></a></p> </blockquote> <p class="__feedview__feedItemTitle">Also to test it instead of using response.write can i use the following?</p> <blockquote> <p class="__feedview__feedItemTitle">Label1.Text = j; (or something on the same lines as this)</p> </blockquote> <p class="__feedview__feedItemTitle">Again thank you, really appreciate your help.</p> <p class="__feedview__feedItemTitle">Regards</p> 2009-01-06T00:29:08-05:002849425http://forums.asp.net/p/1367029/2849425.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>That last code was pulling values from the top feed. This one will pull the values from the feed which title starts with &quot;The Main UK Lottery&quot;. And I replaced the part responsible for showing the data on the screen with the Label:</p> <blockquote><span class="icon-blockquote"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XElement xEl = XElement.Load(&quot;http://www.schok.co.uk/lottery/lottery.xml&quot;);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var lastDraw = (from p in xEl.Descendants(&quot;item&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where p.Element(&quot;title&quot;).Value.StartsWith(&quot;The Main UK Lottery&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select p.Element(&quot;description&quot;).Value).FirstOrDefault();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (lastDraw != null)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string[] lastDrawLetters = lastDraw.Split(' ');<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ArrayList nums = new ArrayList();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; lastDrawLetters.Count(); i&#43;&#43;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double j = 0;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (double.TryParse(lastDrawLetters[i], out j))<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nums.Add(j);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label1.Text &#43;= j &#43; &quot;&lt;br/&gt;&quot;;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</blockquote> <p></p> 2009-01-06T10:35:24-05:002849623http://forums.asp.net/p/1367029/2849623.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>Thanks the feed is now showing the 6 winning numbers and the bonus ball, but it is also showing the ball set which i dont really need, can i take the ball set number out?</p> <blockquote><font size="2"></font><font color="#2b91af" size="2"><font color="#2b91af" size="2">XElement</font></font><font size="2"> xEl = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">XElement</font></font><font size="2">.Load(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;http://www.schok.co.uk/lottery/lottery.xml&quot;</font></font><font size="2">);</font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">var</font></font><font size="2"> lastDraw = (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">from</font></font><font size="2"> p </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">in</font></font><font size="2"> xEl.Descendants(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;item&quot;</font></font><font size="2">)</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">where</font></font><font size="2"> p.Element(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;title&quot;</font></font><font size="2">).Value.StartsWith(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;The Main UK Lottery&quot;</font></font><font size="2">)</font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">select</font></font><font size="2"> p.Element(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;description&quot;</font></font><font size="2">).Value).FirstOrDefault();</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (lastDraw != </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">null</font></font><font size="2">)</font><font size="2"> <p>{</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">string</font></font><font size="2">[] lastDrawLetters = lastDraw.Split(</font><font color="#a31515" size="2"><font color="#a31515" size="2">' '</font></font><font size="2">);</font><font size="2"> <p></font><font color="#2b91af" size="2"><font color="#2b91af" size="2">ArrayList</font></font><font size="2"> nums = </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">ArrayList</font></font><font size="2">();</p> Label1.Text = </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;The winning numbers for this week are: &quot;</font></font><font size="2">;</font><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">for</font></font><font size="2"> (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">int</font></font><font size="2"> i = 0; i &lt; lastDrawLetters.Count(); i&#43;&#43;)</font><font size="2"> <p>{</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">double</font></font><font size="2"> j = 0;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">double</font></font><font size="2">.TryParse(lastDrawLetters[i], </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">out</font></font><font size="2"> j))</font><font size="2"> <p>{</p> <p>nums.Add(j);</p> Label3.Text &#43;= j &#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;, &quot;</font></font><font size="2">;</font><font size="2"> <p></font><font color="#008000" size="2"><font color="#008000" size="2">//Response.Write(j &#43; &quot;, &quot;);</p> </font></font><font size="2"> <p>}</p> <p>}</p> <p>}</p> </blockquote> <p>Regards</p> </font> 2009-01-06T12:22:36-05:002849698http://forums.asp.net/p/1367029/2849698.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>If the number of the winning numbers will always be the same, you can use this:</p> <blockquote><span class="icon-blockquote"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XElement xEl = XElement.Load(&quot;<a href="http://www.schok.co.uk/lottery/lottery.xml">http://www.schok.co.uk/lottery/lottery.xml</a>&quot;);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var lastDraw = (from p in xEl.Descendants(&quot;item&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where p.Element(&quot;title&quot;).Value.StartsWith(&quot;The Main UK Lottery&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select p.Element(&quot;description&quot;).Value).FirstOrDefault();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (lastDraw != null)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string[] lastDrawLetters = lastDraw.Split(' ');<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ArrayList nums = new ArrayList();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; lastDrawLetters.Count(); i&#43;&#43;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double j = 0;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (double.TryParse(lastDrawLetters[i], out j))<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> <strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nums.Count &lt; 7)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</strong><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nums.Add(j);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label1.Text &#43;= j &#43; &quot;, &quot;;<br> <strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> </strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> <strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label1.Text = Label1.Text.Remove(Label1.Text.LastIndexOf(&quot;,&quot;));</strong><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</blockquote> <p></p> 2009-01-06T13:04:14-05:002849787http://forums.asp.net/p/1367029/2849787.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>Thanks, would i be able to check the numbers against a database? Is it possible to do this with the example below..?</p> <blockquote><font size="2"> <p>numbersTableAdapters.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">numbersTableAdapter</font></font><font size="2"> num = </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</p> </font></font><font size="2">numbersTableAdapters.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">numbersTableAdapter</font></font><font size="2">();</font><font size="2"> <p></font><font color="#2b91af" size="2"><font color="#2b91af" size="2">numbers</font></font><font size="2">.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">numbersDataTable</font></font><font size="2"> numtable = num.GetNumbers();</p> Label2.Text = </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;&quot;</font></font><font size="2">;</font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">foreach</font></font><font size="2"> (</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">DataRow</font></font><font size="2"> row </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">in</font></font><font size="2"> numtable.Rows)</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (TextBox1.Text == System.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Convert</font></font><font size="2">.ToString(row[</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;number1&quot;</font></font><font size="2">]))</font><font size="2"> <p>{</p> Label2.Text = Label2.Text &#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot; Mr &quot;</font></font><font size="2"> &#43; System.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Convert</font></font><font size="2">.ToString(row[</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;name&quot;</font></font><font size="2">])</font><font size="2">&#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;, you have won&lt;BR&gt;&quot;</font></font><font size="2">;</font><font size="2"> <p>}</p> </blockquote> <p>Also&nbsp;the following code:-</p> <blockquote><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">for</font></font><font size="2"> (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">int</font></font><font size="2"> i = 0; i &lt; lastDrawLetters.Count(); i&#43;&#43;)</font></font><font size="2"> <p>{</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">double</font></font><font size="2"> j = 0;</font><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">double</font></font><font size="2">.TryParse(lastDrawLetters[i], </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">out</font></font><font size="2"> j))</font><font size="2"> <p>{</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (nums.Count &lt; 7)</font><font size="2"> <p>{</p> <p>nums.Add(j);</p> Label1.Text &#43;= j &#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;, &quot;</font></font><font size="2">;</font><font size="2"> <p>}</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (nums.Count == 7)</font><font size="2"> <p>{</p> <p>nums.Add(j);</p> Label3.Text &#43;= </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;, and the bonus ball is &quot;</font></font><font size="2"> &#43; j;</font><font size="2"> <p>}</p> </font> <p><font color="#008000" size="2"><font color="#008000" size="2"></p> </font></font><font size="2">} <p>}</p> </blockquote> <p>shows </p> <blockquote> <p><span id="ctl00_ContentPlaceHolder1_Label1">The winning numbers for this week are: 39, 37, 19, 49, 9, 36, 10</span> <span id="ctl00_ContentPlaceHolder1_Label3">, and the bonus ball is 10</span> </p> </blockquote> <p>Can i remove the first duplicate 10 by any chace?</p> <p>Regards</p> </font> 2009-01-06T13:49:08-05:002849964http://forums.asp.net/p/1367029/2849964.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>For the first question, you will instead of this:</p> <blockquote><span class="icon-blockquote"></span>if (TextBox1.Text == System.Convert.ToString(row[&quot;number1&quot;]))</blockquote> use something like this: <blockquote><span class="icon-blockquote"></span>if (nums[0].ToString() == row[&quot;number1&quot;].ToString())</blockquote> And this code will resolve your second question: <blockquote><span class="icon-blockquote"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XElement xEl = XElement.Load(&quot;<a href="http://www.schok.co.uk/lottery/lottery.xml">http://www.schok.co.uk/lottery/lottery.xml</a>&quot;);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var lastDraw = (from p in xEl.Descendants(&quot;item&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where p.Element(&quot;title&quot;).Value.StartsWith(&quot;The Main UK Lottery&quot;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select p.Element(&quot;description&quot;).Value).FirstOrDefault();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (lastDraw != null)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string[] lastDrawLetters = lastDraw.Split(' ');<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ArrayList nums = new ArrayList();<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; lastDrawLetters.Count(); i&#43;&#43;)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double j = 0;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (double.TryParse(lastDrawLetters[i], out j))<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nums.Count &lt; 6)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nums.Add(j);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label1.Text &#43;= j &#43; &quot;, &quot;;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if (nums.Count == 6)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nums.Add(j);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label1.Text = Label1.Text.Remove(Label1.Text.LastIndexOf(&quot;,&quot;));<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Label1.Text &#43;= &quot; and the bonus ball is &quot; &#43; j;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</blockquote> <p></p> 2009-01-06T15:07:47-05:002850526http://forums.asp.net/p/1367029/2850526.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>Hey,</p> <p>Im trying to check the numbers with the database but it is not showing anything.. code is below</p> <blockquote><font size="2"></font><font color="#2b91af" size="2"><font color="#2b91af" size="2">XElement</font></font><font size="2"> xEl = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">XElement</font></font><font size="2">.Load(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;http://www.schok.co.uk/lottery/lottery.xml&quot;</font></font><font size="2">);</font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">var</font></font><font size="2"> lastDraw = (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">from</font></font><font size="2"> p </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">in</font></font><font size="2"> xEl.Descendants(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;item&quot;</font></font><font size="2">)</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">where</font></font><font size="2"> p.Element(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;title&quot;</font></font><font size="2">).Value.StartsWith(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;The Main UK Lottery&quot;</font></font><font size="2">)</font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">select</font></font><font size="2"> p.Element(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;description&quot;</font></font><font size="2">).Value).FirstOrDefault();</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (lastDraw != </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">null</font></font><font size="2">)</font><font size="2"> <p>{</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">string</font></font><font size="2">[] lastDrawLetters = lastDraw.Split(</font><font color="#a31515" size="2"><font color="#a31515" size="2">' '</font></font><font size="2">);</font><font size="2"> <p></font><font color="#2b91af" size="2"><font color="#2b91af" size="2">ArrayList</font></font><font size="2"> nums = </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">ArrayList</font></font><font size="2">();</p> <p>numbersTableAdapters.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">syndicate_membersTableAdapter</font></font><font size="2"> num = </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</p> </font></font><font size="2">numbersTableAdapters.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">syndicate_membersTableAdapter</font></font><font size="2">();</font><font size="2"> <p></font><font color="#2b91af" size="2"><font color="#2b91af" size="2">numbers</font></font><font size="2">.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">syndicate_membersDataTable</font></font><font size="2"> numtable = num.GetNumbers();</p> Label1.Text = </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;&quot;</font></font><font size="2">;</font><font size="2"> <p>Label1.Text = </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;The winning numbers for this week are: &quot;</font></font><font size="2">;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">for</font></font><font size="2"> (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">int</font></font><font size="2"> i = 0; i &lt; lastDrawLetters.Count(); i&#43;&#43;)</font><font size="2"> <p>{</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">double</font></font><font size="2"> j = 0;</font><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">double</font></font><font size="2">.TryParse(lastDrawLetters[i], </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">out</font></font><font size="2"> j))</font><font size="2"> <p>{</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (nums.Count &lt; 6)</font><font size="2"> <p>{</p> <p>nums.Add(j);</p> Label1.Text &#43;= j &#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;, &quot;</font></font><font size="2">;</font><font size="2"> <p>}</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">else</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (nums.Count == 6)</font><font size="2"> <p>{</p> <p>nums.Add(j);</p> Label1.Text = Label1.Text.Remove(Label1.Text.LastIndexOf(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;,&quot;</font></font><font size="2">));</font><font size="2">Label1.Text &#43;= </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot; and the bonus ball is &quot;</font></font><font size="2"> &#43; j;</font><font size="2"> <p>}</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">foreach</font></font><font size="2"> (</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">DataRow</font></font><font size="2"> row </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">in</font></font><font size="2"> numtable.Rows)</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (nums[0].ToString() == row[</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;num1&quot;</font></font><font size="2">])</font><font size="2"> <p>{</p> Label3.Text = Label3.Text &#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;Congratulations &quot;</font></font><font size="2"> &#43; System.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Convert</font></font><font size="2">.ToString(row[</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;mem_name&quot;</font></font><font size="2">])</font><font size="2">&#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;, you have won&lt;BR&gt;&quot;</font></font><font size="2">;</font><font size="2"> <p>}</p> </blockquote> <p>Label 3 is not showing anything, it is staying blank...</p> <p>Regards</p> <p>&nbsp;</p> </font> 2009-01-06T20:39:10-05:002852007http://forums.asp.net/p/1367029/2852007.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>I am now trying to use the following:-</p> <blockquote><font color="#0000ff" size="2"><font color="#0000ff" size="2">protected</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">void</font></font><font size="2"> Page_Load(</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">object</font></font><font size="2"> sender, </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">EventArgs</font></font><font size="2"> e)</font><font size="2"> <p>{</p> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">XElement</font></font><font size="2"> xEl = </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">XElement</font></font><font size="2">.Load(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;http://www.schok.co.uk/lottery/lottery.xml&quot;</font></font><font size="2">);</font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">var</font></font><font size="2"> lastDraw = (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">from</font></font><font size="2"> p </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">in</font></font><font size="2"> xEl.Descendants(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;item&quot;</font></font><font size="2">)</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">where</font></font><font size="2"> p.Element(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;title&quot;</font></font><font size="2">).Value.StartsWith(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;The Main UK Lottery&quot;</font></font><font size="2">)</font><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">select</font></font><font size="2"> p.Element(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;description&quot;</font></font><font size="2">).Value).FirstOrDefault();</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (lastDraw != </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">null</font></font><font size="2">)</font><font size="2"> <p>{</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">string</font></font><font size="2">[] lastDrawLetters = lastDraw.Split(</font><font color="#a31515" size="2"><font color="#a31515" size="2">' '</font></font><font size="2">);</font><font size="2"> <p></font><font color="#2b91af" size="2"><font color="#2b91af" size="2">ArrayList</font></font><font size="2"> nums = </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">ArrayList</font></font><font size="2">();</p> <p>numbersTableAdapters.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">syndicate_membersTableAdapter</font></font><font size="2"> num = </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</p> </font></font><font size="2">numbersTableAdapters.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">syndicate_membersTableAdapter</font></font><font size="2">();</font><font size="2"> <p></font><font color="#2b91af" size="2"><font color="#2b91af" size="2">numbers</font></font><font size="2">.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">syndicate_membersDataTable</font></font><font size="2"> numtable = num.GetNumbers();</p> Label1.Text = </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;The winning numbers for this week are: &quot;</font></font><font size="2">;</font><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">for</font></font><font size="2"> (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">int</font></font><font size="2"> i = 0; i &lt; lastDrawLetters.Count(); i&#43;&#43;)</font><font size="2"> <p>{</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">double</font></font><font size="2"> j = 0;</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (</font><font color="#0000ff" size="2"><font color="#0000ff" size="2">double</font></font><font size="2">.TryParse(lastDrawLetters[i], </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">out</font></font><font size="2"> j))</font><font size="2"> <p>{</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (nums.Count &lt; 6)</font><font size="2"> <p>{</p> <p>nums.Add(j);</p> Label1.Text &#43;= j &#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;, &quot;</font></font><font size="2">;</font><font size="2"> <p>}</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">else</font></font><font size="2"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (nums.Count == 6)</font><font size="2"> <p>{</p> <p>nums.Add(j);</p> Label1.Text = Label1.Text.Remove(Label1.Text.LastIndexOf(</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;,&quot;</font></font><font size="2">));</font><font size="2">Label1.Text &#43;= </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot; and the bonus ball is &quot;</font></font><font size="2"> &#43; j;</font><font size="2"> <p>}</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">foreach</font></font><font size="2"> (</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">DataRow</font></font><font size="2"> row </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">in</font></font><font size="2"> numtable.Rows)</p> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (nums[0] == row[</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;num1&quot;</font></font><font size="2">].ToString())</font><font size="2"> <p>{</p> Label3.Text = Label3.Text &#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;Congratulations &quot;</font></font><font size="2"> &#43; System.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Convert</font></font><font size="2">.ToString(row[</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;mem_name&quot;</font></font><font size="2">])</font><font size="2">&#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;, you have won&lt;BR&gt;&quot;</font></font><font size="2">;</font><font size="2"> <p>}</p> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">else</p> </font></font><font size="2"> <p>{</p> Label3.Text = </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;&lt;b style ='color:red'&gt;Sorry, unfortunately you have no winners.&lt;/b&gt;&quot;</font></font><font size="2">;</font><font size="2">GridView1.Visible = </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">false</font></font><font size="2">;</font><font size="2"> <p>}</p> <p>}</p> <p>}</p> <p>}</p> <p>&nbsp;</p> </blockquote> <p>But the label is still showing as blank, it does not show who has got a matching number..</p> <p>Regards</p> <p>&nbsp;</p> </font> 2009-01-07T12:35:50-05:002852050http://forums.asp.net/p/1367029/2852050.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>You should check do you get any result in &quot;numtable&quot;. Second, this line:</p> <blockquote><span class="icon-blockquote"></span>if(nums[0].ToString() == row[&quot;num1&quot;].ToString())</blockquote> will check is the first drawn number same as number in &quot;num1&quot; column. You should check if that is a logic you want. <p></p> 2009-01-07T12:50:49-05:002852082http://forums.asp.net/p/1367029/2852082.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>Hey,</p> <p>The logic should work but i think the following line:-</p> <blockquote><font size="2"> <p></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (nums[0].ToString() == row[</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;num1&quot;</font></font><font size="2">].ToString())</font></p> </blockquote> <p><font size="2">is not checking the correct line, I have checked the Dataset that i have made and it does have a column called &quot;num1&quot;. Eventually i will check for all 6 columns but i thought i could do the first one before doing this. </font></p> <blockquote><font size="2"><font size="2"></font><font color="#0000ff" size="2"><font color="#0000ff" size="2">if</font></font><font size="2"> (nums[0].ToString() == row[</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;num1&quot;</font></font><font size="2">].ToString())</font></font><font size="2"> <p>{</p> Label3.Text = Label3.Text &#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;Congratulations &quot;</font></font><font size="2"> &#43; System.</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">Convert</font></font><font size="2">.ToString(row[</font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;mem_name&quot;</font></font><font size="2">])</font><font size="2">&#43; </font><font color="#a31515" size="2"><font color="#a31515" size="2">&quot;, you have won&lt;BR&gt;&quot;</font></font><font size="2">;</font><font size="2"> <p>}</p> </blockquote> <p>I think there is obviously something wrong with the If statement, because it should atleast say &quot;Congratulations &quot; even though it may not recognise row[&quot;num1&quot;]..</p> <p>Any ideas</p> <p>Regards</p> </font> 2009-01-07T13:13:16-05:002852116http://forums.asp.net/p/1367029/2852116.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>If you didn't get the text &quot;Sorry, unfortunately you have no winners.&quot;, that means that you don't have any data in &quot;numtable&quot;. You can check that if you set breakpoint in Visual Studio, or, if you're not farmiliar with breakpoints, add Gridview to your page and add this code:</p> <blockquote><span class="icon-blockquote"></span>GridView1.DataSource = numtable;<br> GridView1.DataBind();</blockquote> after this line <blockquote><span class="icon-blockquote"></span>numbers.syndicate_membersDataTable numtable = num.GetNumbers();</blockquote> <p></p> 2009-01-07T13:28:08-05:002852149http://forums.asp.net/p/1367029/2852149.aspx/1?Re+random+number+linked+with+imagesRe: random number linked with images <p>Hey,</p> <p>&nbsp;I do get the text &quot;Sorry, unfortunately you have no winners.&quot;, so this means i have data in numtable. </p> <p>However i have just tried the code you suggested and it gives the following error:-</p> <blockquote> <p>Both DataSource and DataSourceID are defined on 'GridView1'.&nbsp; Remove one definition.</p> </blockquote> 2009-01-07T13:39:19-05:00