Based on your feeback, I tried the following code.
Here's my form for your review.
<rb

laceHolder ID="PlaceHolder1" runat="server">
</rb

laceHolder>
<rb:Form ID="Form1" runat="server" Method = "POST">
<Rows>
</Rows>
<Content>
<rb:Form_Text ID="Form_Text2" runat="server" >
</rb:Form_Text>
<rb:Form_Submit ID="Form_Submit1" runat="server" Name="submit" Value="submit">
</rb:Form_Submit>
</Content>
</rb:Form>
When I enter value into the text field and submit, the following code (in code behind on page load) does not work. I could not read the text field. What am I missing?
if (Form1.FindControl("Form_Text2") != null)
{
if (!string.IsNullOrEmpty(((Form_Text)Form1.FindControl("Form_Text2")).Value))
{
Text validationError = new Text();
validationError.BGColor = System.Drawing.Color.Red;
validationError.RichText = "im here";
// validationError.RichText = ((Form_Text)Form1.FindControl("Form_Text2")).Value;
this.PlaceHolder1.Controls.Add(validationError);
}
else
{
Text validationError = new Text();
validationError.BGColor = System.Drawing.Color.Red;
validationError.RichText = "im here. Could not read the text field";
// validationError.RichText = ((Form_Text)Form1.FindControl("Form_Text2")).Value;
this.PlaceHolder1.Controls.Add(validationError);
}
}
I'm able to set the value though by using the following code.
//if (Form1.FindControl("Form_Text2") != null)
// ((Form_Text)Form1.FindControl("Form_Text2")).Value = "hello";