B
Bostonasian
Lads,
I've created a custom web control that's consisted of dropdown box and
text box.
In drop down there are following items:
[text] | [value]
"is" | "{val}"
"starts with"| "{val}%"
"ends with" | "%{val}"
"contains" | "%{val}%"
Upon postback, I want to replace {val} with what's entered in text box.
Therefore if "sky" being entered in text box and "ends with" selected
in dropdown list,
"%sky" will be returned.
In custom web controls, I've got following code,
public class SearchTextBox : Table,INamingContainer
{
ConditionDropDown conDd = new ConditionDropDown();
TextBox searchTxtBx = new TextBox();
protected override HtmlTextWriterTag TagKey
{
get { return HtmlTextWriterTag.Table; }
}
protected override void CreateChildControls()
{
TableRow row = new TableRow();
TableCell ddCell = new TableCell();
TableCell txtBxCell = new TableCell();
ddCell.HorizontalAlign = HorizontalAlign.Right;
txtBxCell.HorizontalAlign = HorizontalAlign.Left;
ddCell.Controls.Add(conDd);
txtBxCell.Controls.Add(searchTxtBx);
row.Cells.Add(ddCell);
row.Cells.Add(txtBxCell);
Rows.Add(row);
}
protected override void OnInit(EventArgs e)
{
conDd.ID = "ddCondition";
searchTxtBx.ID = "txtBxSearchStr";
base.OnInit(e);
EnsureChildControls();
}
}
What do I need to add/modify in order to return processed value in
implemented page?
I've created a custom web control that's consisted of dropdown box and
text box.
In drop down there are following items:
[text] | [value]
"is" | "{val}"
"starts with"| "{val}%"
"ends with" | "%{val}"
"contains" | "%{val}%"
Upon postback, I want to replace {val} with what's entered in text box.
Therefore if "sky" being entered in text box and "ends with" selected
in dropdown list,
"%sky" will be returned.
In custom web controls, I've got following code,
public class SearchTextBox : Table,INamingContainer
{
ConditionDropDown conDd = new ConditionDropDown();
TextBox searchTxtBx = new TextBox();
protected override HtmlTextWriterTag TagKey
{
get { return HtmlTextWriterTag.Table; }
}
protected override void CreateChildControls()
{
TableRow row = new TableRow();
TableCell ddCell = new TableCell();
TableCell txtBxCell = new TableCell();
ddCell.HorizontalAlign = HorizontalAlign.Right;
txtBxCell.HorizontalAlign = HorizontalAlign.Left;
ddCell.Controls.Add(conDd);
txtBxCell.Controls.Add(searchTxtBx);
row.Cells.Add(ddCell);
row.Cells.Add(txtBxCell);
Rows.Add(row);
}
protected override void OnInit(EventArgs e)
{
conDd.ID = "ddCondition";
searchTxtBx.ID = "txtBxSearchStr";
base.OnInit(e);
EnsureChildControls();
}
}
What do I need to add/modify in order to return processed value in
implemented page?