Simple Data Issue, I think.http://forums.asp.net/t/1736849.aspx/1?Simple+Data+Issue+I+think+Fri, 04 Nov 2011 16:23:51 -040017368494668310http://forums.asp.net/p/1736849/4668310.aspx/1?Simple+Data+Issue+I+think+Simple Data Issue, I think. <pre class="prettyprint">So, I'm trying to make a practice page. I'm trying to teach myself this technology. Anyway, as for my issue, I'm having an issue sending the value from the 'other' textbox (TextBox1) to the OtherColor.aspx. It has a problem with me using the script in the font forecolor and text to &lt;%var color = Server.UrlDecode(Request.QueryString[&quot;Data&quot;]);%&gt;. Am I missing something? Is there a way to make it a string variable to pass into the text setting command? The idea is that I want to have someone enter a color in the textbox and when they hit submit have their color show up as text and as the color of that text. I'm not checking the vaildity of the entered color yet. HOME PAGE ASPX: &lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;Default.aspx.cs&quot; Inherits=&quot;WebApplication1.WebForm1&quot; %&gt; &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt; &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; &lt;head runat=&quot;server&quot;&gt; &lt;title&gt;Pick Your Color!&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt; &lt;div&gt; &lt;h1&gt;Pick Your Color!&lt;/h1&gt; &lt;asp:RadioButtonList ID=&quot;RadioButtonList1&quot; runat=&quot;server&quot;&gt; &lt;asp:ListItem Selected=&quot;True&quot;&gt;RED&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;BLUE&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Other&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt; &lt;asp:TextBox ID=&quot;TextBox1&quot; runat=&quot;server&quot;&gt;&lt;/asp:TextBox&gt; &lt;br /&gt; &lt;br /&gt; &lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; Text=&quot;Submit&quot; onclick=&quot;Button1_Click&quot; /&gt; &lt;/div&gt; &lt;p&gt; &amp;nbsp;&lt;/p&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; HOME PAGE ASPX CS: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication1 { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { if (this.RadioButtonList1.SelectedValue == &quot;BLUE&quot;) { Response.Redirect(&quot;Blue.aspx&quot;); } else if (this.RadioButtonList1.SelectedValue == &quot;RED&quot;) { Response.Redirect(&quot;Red.aspx&quot;); } else { Response.Redirect(&quot;OtherColor.aspx?Data=&quot; &#43; Server.UrlEncode(TextBox1.Text)); } } protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { } } } OTHER PAGE: &lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;OtherColor.aspx.cs&quot; Inherits=&quot;WebApplication1.WebForm3&quot; %&gt; &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt; &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; &lt;head runat=&quot;server&quot;&gt; &lt;%var color = Server.UrlDecode(Request.QueryString[&quot;Data&quot;]);%&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt; &lt;div&gt; &lt;asp:Label ID=&quot;Label1&quot; runat=&quot;server&quot; Text=color ForeColor=color&gt;&lt;/asp:Label&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; OTHER PAGE CS: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication1 { public partial class WebForm3 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } } }</pre> 2011-11-04T14:38:51-04:004668342http://forums.asp.net/p/1736849/4668342.aspx/1?Re+Simple+Data+Issue+I+think+Re: Simple Data Issue, I think. <p>I just added &lt;%=Server.UrlDecode(Request.QueryString[&quot;Data&quot;])&nbsp;%&gt; to the viewable text on the page and it does return the string entered in the textbox on the first page. Why won't it take it as input for text or ForeColor?</p> 2011-11-04T14:54:59-04:004668393http://forums.asp.net/p/1736849/4668393.aspx/1?Re+Simple+Data+Issue+I+think+Re: Simple Data Issue, I think. <p>Hi ,&nbsp;</p> <p>Why don't you do it from code behind of OtherColor.aspx. This code works fine for me .</p> <pre class="prettyprint">using System.Drawing; public partial class Default4 : System.Web.UI.Page { protected string strColor; protected void Page_Load(object sender, EventArgs e) { strColor = Server.UrlDecode(Request.QueryString[&quot;Data&quot;]); Label1.BackColor = Color.FromName(strColor); } }</pre> <p></p> 2011-11-04T15:27:26-04:004668476http://forums.asp.net/p/1736849/4668476.aspx/1?Re+Simple+Data+Issue+I+think+Re: Simple Data Issue, I think. <p>Took some tweaking to get desired behavior but this put me on the right track. Thank you!</p> 2011-11-04T16:23:51-04:00