It can be implemented, and for the convenience of the demonstration I use Session to pass the data.
Step 1: Select the color the user wants and enter his email address
<body>
<form id="form1" runat="server" >
<div >
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<h1>Create a Business Card</h1>
<asp:Label
ID="lblCardText"
Text="Card Text"
AssociatedControlID="txtCardText"
runat="server" />
<br />
<asp:TextBox
ID="txtCardText"
Runat="server" />
<br /><br />
<asp:Label
ID="lblCardColor"
Text="Card Color"
AssociatedControlID="txtCardColor"
runat="server" />
<br />
<asp:TextBox
ID="txtCardColor"
AutoCompleteType="None"
Runat="server" />
<asp:Button
ID="btnPickColor"
Text="Pick Color"
Runat="server" />
<asp:Label
ID="lblSample"
Runat="Server" BackColor="#33FF99"> Sample </asp:Label>
<cc1:ColorPickerExtender
ID="txtCardColor_ColorPickerExtender"
TargetControlID="txtCardColor"
PopupButtonID="btnPickColor"
PopupPosition="TopRight"
SampleControlID="lblSample"
Enabled="True"
runat="server">
</cc1:ColorPickerExtender>
<br /><br />
<asp:Button
ID="btnSubmit"
Text="Submit"
Runat="server"
onclick="btnSubmit_Click"/>
</div>
</form>
</body>
public string color="";
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
color = "background-color:#"+ txtCardColor.Text;
Session["Color"] = color;
Session["Email"] = txtCardText.Text;
Response.Redirect("WebForm1.aspx");
}
Step 2: Receive the data of the previous page through the Session and transfer the value from the back-end to the front-end through the <%=%> method.
public partial class WebForm1 : System.Web.UI.Page
{
public static string a;
public static string b;
protected void Page_Load(object sender, EventArgs e)
{
a = Session["Email"].ToString();
b = Session["Color"].ToString();
}
}
<form id="form1" runat="server">
Email:<%=a %>
Color:<%=b %>
<div style=<%=b %>>
<br />
Test
</div>
</form>
Similarly, if you are stored through a database, just store the data of page 1 in the database and read it out on page 2.
Best Regards
Qi You
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.