Hi All,

I am attaching the source for my existing search contol source code 
here, please help me to integrate the similar functionality using 
wilson web form.
Charles suggested me to use Wilson Web Form for the problem I am 
facing.
Any optional solution will also do.

With Regards
Amogh

Search.ascx:

<%@ Control Language="c#" AutoEventWireup="false" 
Codebehind="SearchControl.ascx.cs" 
Inherits="SearchConC.SearchControl" 
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"; %>
<FONT size="2"><FONT face="Arial">
                <TABLE id="Table1" cellSpacing="0" cellPadding="0" 
width="722" border="0" style="HEIGHT: 64px">
                        <TBODY>
                                <TR>
                                        <TD align="left">
                                        </TD>
                                </TR>
                                <TR>
                                        <TD align="left" 
bgColor="#ccccfe" style="HEIGHT: 23px"><FONT size="2">
                                                
        <asp:PlaceHolder id="PlaceHolder1" 
runat="server"></asp:PlaceHolder>
                                                </FONT>
                                        </TD>
                                </TR>
                                <TR>
                                        <TD align="center" 
bgColor="#ffffcc" style="HEIGHT: 17px">
                                                <P 
align="left"><FONT size="2">Limit Search result per page to: </FONT>
                                                
        <asp:DropDownList id="ddlItemsPerPage" runat="server">
                                                        
        <asp:ListItem Value="10">10 Items</asp:ListItem>
                                                        
        <asp:ListItem Value="20">20 Items</asp:ListItem>
                                                        
        <asp:ListItem Value="30">30 Items</asp:ListItem>
                                                        
        <asp:ListItem Value="40">40 Items</asp:ListItem>
                                                        
        <asp:ListItem Value="50">50 Items</asp:ListItem>
                                                
        </asp:DropDownList><FONT 
size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp; 
                                                        
        Allow the use of wildcards( % ^ _ [ ] ):&nbsp;&nbsp;</FONT>
                                                
        <asp:CheckBox id="chkAllowWildcards" 
runat="server"></asp:CheckBox></P>
                                        </TD>
                                </TR>
                                <TR>
                                        <TD align="center" 
bgColor="#ffffcc">
                                                <P>
                                                        <asp:Label 
id="lblError" runat="server" BackColor="Red" ForeColor="White" Font-
Bold="True"
                                                        
        Width="100%" Visible="False" Height="8px"></asp:Label></P>
                                        </TD>
                                </TR>
                                <TR>
                                        <TD align="center" 
bgColor="#ffffcc">
                                                <P 
align="center"><FONT size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
        </FONT></TD></TR></TBODY></TABLE> </FONT></FONT>


Search.ascx.cs 

namespace SearchConC
{
        
        using System;
        using System.Data;
        using System.Data.SqlClient;
        using System.Drawing;
        using System.Web;
        using System.Web.UI.WebControls;
        using System.Web.UI.HtmlControls;
        using System.Text.RegularExpressions;
        using System.Collections;
        using System.Web.UI;
        using System.Runtime.Serialization.Formatters.Binary;
        using System.IO;
        /// <summary>
        ///             Summary description for SearchControl.
        /// </summary>
        public class SearchControl : System.Web.UI.UserControl
        {
                static string _fileName;
                string _responseResult;
                string _TableName;
                string _SearchString;
                protected System.Web.UI.WebControls.PlaceHolder 
PlaceHolder1;
                protected System.Web.UI.WebControls.DropDownList 
ddlItemsPerPage;
                protected System.Web.UI.WebControls.CheckBox 
chkAllowWildcards;
                protected System.Web.UI.WebControls.Label lblError;
                int _ItemsPerPage ;
                string[] arrField= new string[1];
                string[] arrAlias= new string[1];
                string[] arrSearch= new string[1];
                string[] arrValue= new string[1];
                bool[] arrAnd=  new bool[1];


                private string myLeft(string host, int index)
                {
                        return host.Substring(0,index);
                }


                private string myRight(string host, int index)
                {
                        return host.Substring(host.Length -index);
                }


                public void SimulateRedimPreserveInVB()
                {
                        string[] arrStrings = new string[1]; //this 
array needs to be redim preserve to 5000
                        int i;

                        Trace.Write("Redim","Start");

                        for (i=1;i<=5000;i++)
                        {
                                string[] arrHelper = new string[i];
                                arrStrings.CopyTo(arrHelper, 0);
                                arrHelper[i-1] = i.ToString();
                                arrStrings = arrHelper;
                        }

                        Trace.Write("Redim","End");

                }


                public void simulateRedimPreseveByUsinArrayList()
                {
                        ArrayList arrList = new ArrayList(100);
                        long  i ;
                        Trace.Write("ArrayList","Start");
                        for( i = 1 ;i<= 50000;i++)
                        {
                                arrList.Add(i);
                        }
                        Trace.Write("ArrayList","End");

                }


                private static Regex _isNumber = new Regex(@"^\d+$");

                public static bool IsInteger(string theValue)
                {
                        Match m = _isNumber.Match(theValue);
                        return m.Success;
                } //IsInteger

                
                public bool IsNumeric(string s)
                {
                        try 
                        {
                                Int32.Parse(s);
                        }
                        catch 
                        {
                                return false;
                        }
                        return true;
                }

                public static bool IsDecimal(string theValue)
                {
                        try
                        {
                                Convert.ToDouble(theValue);
                                return true;
                        } 
                        catch 
                        {
                                return false;
                        }
                } //IsDecimal


                private void Page_Load(object sender, 
System.EventArgs e)
                {
                        // Put user code to initialize the page here
                        //'The fields to be searched 'combo box 
creation                        
                        if (!(ViewState["SessionNumber"]==null) )
                        {
                                if (!IsNumeric(ViewState
["SessionNumber"].ToString()))
                                {
                                        ViewState["SessionNumber"] = 
0;
                                }

                        }
                        else
                        {
                                ViewState["SessionNumber"] = 0;
                        }

                        if (Page.IsPostBack == false )
                        {
                                addControls(true);
                                //'addControls(false)
                        }
                        else
                        {
                                rebuildPlaceHolder();
                        }


                }

                public string fileName
                {
                        get
                        {
                                return _fileName;
                        }
                        set
                        {
                                _fileName=value;
                        }
                }


                



                public string tableName
                {
                        get
                        {
                                return _TableName;
                        }
                        set
                        {
                                _TableName=value;
                        }
                }


                public string  responseResult
                {
                        get
                        {
                                return _responseResult;
                        }
                        set
                        {
                                _responseResult = value;
                        }
                }



                public int  ItemsPerPage
                {
                        get
                        {
                                return Int32.Parse
(ddlItemsPerPage.SelectedItem.Value);
                        }
                        set
                        {
                                _ItemsPerPage = value;
                                ddlItemsPerPage.SelectedIndex = 
ddlItemsPerPage.Items.IndexOf(ddlItemsPerPage.Items.FindByValue
(_ItemsPerPage.ToString()));
                        }
                }
        
                void rebuildPlaceHolder()
                {
                        
                        LiteralControl spacer1;
                        int jk=Int32.Parse(ViewState
["SessionNumber"].ToString());
                        for (int i = 1 ;i<= jk;i++)
                        {
                                
                                //'Dim spacer1 As LiteralControl = 
new LiteralControl("Find " + Session("SearchWord") + " where ");
                                spacer1 = new LiteralControl
("&nbsp;&nbsp;&nbsp;");
                                spacer1.ID = "spacer1" + i;
                                PlaceHolder1.Controls.Add(spacer1);

                                //'Add the fields names search combo 
box
                                DropDownList c = new DropDownList();
                                c.ID = "c" + i;
                                System.Xml.XmlTextReader x = new 
System.Xml.XmlTextReader(fileName);
                                ListItem l = new ListItem();
                                l.Text="-1";
                                l.Value="-1";
                                while (x.Read())
                                {                               
        
                                        if (x.NodeType == 
System.Xml.XmlNodeType.Element && x.Name == "Alias" )
                                                l.Text= x.ReadString
();
                                        if (x.NodeType == 
System.Xml.XmlNodeType.Element && x.Name == "Field" )
                                                l.Value=x.ReadString
();
                                        if (l.Text!="-1" && l.Value!
="-1")
                                        {
                                                c.Items.Add(l);
                                                l=null;
                                                l=new ListItem();
                                                l.Text="-1";
                                                l.Value="-1";

                                        }
                                }
                                c.SelectedIndex = c.Items.IndexOf
(c.Items.FindByText(Request.Form["Search1:c" + i]));
                                PlaceHolder1.Controls.Add(c);

                                //      ' Add a spacer in the form 
of HTML elements
                                LiteralControl spacer2 =new 
LiteralControl("&nbsp;&nbsp;&nbsp;");
                                spacer2.ID = "spacer2" + i;
                                PlaceHolder1.Controls.Add(spacer2);

                                //      'The search options combo box
                                DropDownList s = new DropDownList();
                                s.ID = "s" + i;
                                s.Items.Add("Begins with");
                                s.Items.Add("Contains");
                                s.Items.Add("Ends with");
                                s.Items.Add("is exactly");
                                s.Items.Add("is empty");
                                s.Items.Add("is not empty");
                                s.SelectedIndex = s.Items.IndexOf
(s.Items.FindByText(Request.Form["Search1:s" + i]));
                                PlaceHolder1.Controls.Add(s);

                                //      ' Add a spacer in the form 
of HTML elements
                                LiteralControl spacer3 = new 
LiteralControl("&nbsp;&nbsp;&nbsp;");
                                spacer3.ID = "spacer3" + i;
                                PlaceHolder1.Controls.Add(spacer3);

                                //      'The search textbox
                                TextBox t = new TextBox();
                                t.ID = "t" + i;
                                t.Text = Request.Form["Search1:t" + 
i];
                                PlaceHolder1.Controls.Add(t);

                                //      ' Add a spacer in the form 
of HTML elements
                                LiteralControl spacer4  = new 
LiteralControl("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                                spacer4.ID = "spacer4" + i;
                                PlaceHolder1.Controls.Add(spacer4);

                                //      'Add the --AND-- checkbox
                                CheckBox a =new CheckBox();
                                a.ID = "a" + i;
                                a.Text = "And";
                                if (Request.Form["Search1:a" + i]
==null) 
                                {
                                        a.Checked = false;
                                }
                                if (Request.Form["Search1:a" + i] 
== "" )
                                        a.Checked = false;
                                else if (Request.Form["Search1:a" + 
i] == "on" )
                                {
                                        a.Checked = true;
                                }

                                PlaceHolder1.Controls.Add(a);

                                //      ' Add a spacer in the form 
of HTML elements
                                LiteralControl spacer5 = new 
LiteralControl("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                                spacer5.ID = "spacer5" + i;
                                PlaceHolder1.Controls.Add(spacer5);

                                //      'Check to add the --Delete-- 
Icon
                                if (i != 1) 
                                {
                                        ImageButton dsi = new 
ImageButton();
                                        dsi.ID = "dsi" + i;
                                        dsi.ImageUrl 
= "/TIF/images/16x16delete.gif";
                                        dsi.ToolTip = "Delete Search 
Record";
                                        this.Load += new 
System.EventHandler(this.Page_Load);
                                        dsi.Click += new 
System.Web.UI.ImageClickEventHandler(deleteClick);
                                        PlaceHolder1.Controls.Add
(dsi);
                                }
                                else
                                {
                                        //      'Add a spacer in the 
form of HTML Elements to cover image location
                                        LiteralControl spacer6 =new 
LiteralControl("&nbsp;&nbsp;&nbsp;&nbsp;");
                                        spacer6.ID = "spacer6" + i;
                                        PlaceHolder1.Controls.Add
(spacer6);
                                }

                                //      'Add a spacer in the form of 
HTML Elements
                                LiteralControl spacer7 = new 
LiteralControl("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                                spacer7.ID = "spacer7" + i;
                                PlaceHolder1.Controls.Add(spacer7);

                                //      'Add the --Add New Search-- 
ICON
                                ImageButton ns = new ImageButton();
                                ns.ID = "ns" + i;
                                ns.ImageUrl 
= "/TIF/images/Enter.bmp";
                                ns.ToolTip = "Add New Search Record";
                                ns.Click += new 
System.Web.UI.ImageClickEventHandler( addClick);
                                if (i != Int32.Parse(ViewState
["SessionNumber"].ToString() ))
                                {
                                        ns.Visible = false;
                                }
                                PlaceHolder1.Controls.Add(ns);

                                //      'Binding the page
                                Page.DataBind();

                        
        ///////////////////////////////////////
                                LiteralControl spacer1000 =new 
LiteralControl(" <BR> ");
                                spacer1000.ID = "spacer1000" + i;
                                PlaceHolder1.Controls.Add
(spacer1000);


                                
                                ViewState["Placehoder"]
=PlaceHolder1;  
                                

                                        } //end of for
                }//end of function
        
                void addControls(bool firstTime )
                {
                        //'Viewstate implementation
                        ViewState["SessionNumber"] =Int32.Parse
(ViewState["SessionNumber"].ToString())+ 1;

                        //'Dim spacer1 As LiteralControl = New 
LiteralControl("Find " + Session("SearchWord") + " where ")
                        LiteralControl spacer1  = new LiteralControl
("&nbsp;&nbsp;&nbsp;");
                        spacer1.ID = "spacer1" + ViewState
["SessionNumber"];
                        PlaceHolder1.Controls.Add(spacer1);

                        //'Add the fields names search combo box
                        DropDownList c =new DropDownList();
                        c.ID = "c" + ViewState["SessionNumber"];
                        System.Xml.XmlTextReader x =new 
System.Xml.XmlTextReader(fileName);
                        ListItem l = new ListItem();
                        l.Text="-1";
                        l.Value="-1";
                        while (x.Read())
                        {                                       
                                if (x.NodeType == 
System.Xml.XmlNodeType.Element && x.Name == "Alias" )
                                        l.Text= x.ReadString();
                                if (x.NodeType == 
System.Xml.XmlNodeType.Element && x.Name == "Field" )
                                        l.Value=x.ReadString();
                                if (l.Text!="-1" && l.Value!="-1")
                                {
                                        c.Items.Add(l);
                                        l=null;
                                        l=new ListItem();
                                        l.Text="-1";
                                        l.Value="-1";
                                }
                        }


                        PlaceHolder1.Controls.Add(c);

                        //      ' Add a spacer in the form of HTML 
elements
                        LiteralControl spacer2 =new LiteralControl
("&nbsp;&nbsp;&nbsp;");
                        spacer2.ID = "spacer2" + ViewState
["SessionNumber"];
                        PlaceHolder1.Controls.Add(spacer2);

                        //      'The search options combo box
                        DropDownList s =new DropDownList();
                        s.ID = "s" + ViewState["SessionNumber"];
                        s.Items.Add("Begins with");
                        s.Items.Add("Contains");
                        s.Items.Add("Ends with");
                        s.Items.Add("is exactly");
                        s.Items.Add("is empty");
                        s.Items.Add("is not empty");
                        PlaceHolder1.Controls.Add(s);

                        //' Add a spacer in the form of HTML elements
                        LiteralControl spacer3 =new LiteralControl
("&nbsp;&nbsp;&nbsp;");
                        spacer3.ID = "spacer3" + ViewState
["SessionNumber"];
                        PlaceHolder1.Controls.Add(spacer3);

                        //'The search textbox
                        TextBox t =new TextBox();
                        t.ID = "t" + ViewState["SessionNumber"];
                        PlaceHolder1.Controls.Add(t);

                        //' Add a spacer in the form of HTML elements
                        LiteralControl spacer4 =new LiteralControl
("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                        spacer4.ID = "spacer4" + ViewState
["SessionNumber"];
                        PlaceHolder1.Controls.Add(spacer4);

                        //'Add the --AND-- checkbox
                        CheckBox a =new CheckBox();
                        a.ID = "a" + ViewState["SessionNumber"];
                        a.Text = "And";
                        PlaceHolder1.Controls.Add(a);

                        //' Add a spacer in the form of HTML elements
                        LiteralControl spacer5 =new LiteralControl
("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                        spacer5.ID = "spacer5" + ViewState
["SessionNumber"];
                        PlaceHolder1.Controls.Add(spacer5);

                        //'Check to add the --Delete-- Icon
                        if (firstTime == false)
                        {
                                ImageButton dsi = new ImageButton();
                                dsi.ID = "dsi" + ViewState
["SessionNumber"];
                                dsi.ImageUrl 
= "/TIF/images/16x16delete.gif";
                                dsi.ToolTip = "Delete Search Record";
                                dsi.Click += new 
System.Web.UI.ImageClickEventHandler(this.deleteClick);
                                PlaceHolder1.Controls.Add(dsi);
                        }
                        else
                        {
                                //'Add a spacer in the form of HTML 
Elements to cover image location
                                LiteralControl spacer6 = new 
LiteralControl("&nbsp;&nbsp;&nbsp;&nbsp;");
                                spacer6.ID = "spacer6" + ViewState
["SessionNumber"];
                                PlaceHolder1.Controls.Add(spacer6);
                        }

                        //'Add a spacer in the form of HTML Elements
                        LiteralControl spacer7 = new LiteralControl
("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                        spacer7.ID = "spacer7" + ViewState
["SessionNumber"];
                        PlaceHolder1.Controls.Add(spacer7);

                        //'Add the --Add New Search-- ICON
                        ImageButton ns =new ImageButton();
                        ns.ID = "ns" + ViewState["SessionNumber"];
                        ns.ImageUrl = "/TIF/images/Enter.bmp";
                        ns.ToolTip = "Add New Search Record";
                        ns.Click += new 
System.Web.UI.ImageClickEventHandler(addClick);
                        PlaceHolder1.Controls.Add(ns);


                        //'hide all adds
                        if (Int32.Parse(ViewState
["SessionNumber"].ToString()) != 1 )
                        {
                                for (int u = 1 ; u<= (Int32.Parse
(ViewState["SessionNumber"].ToString()) - 1);u++)
                                {
                                        ImageButton ns1  = 
(ImageButton)PlaceHolder1.FindControl("ns" + u);
                                        ns1.Visible = false;
                                }
                        }

                        //'spacer break
                        LiteralControl spacer1000  = new 
LiteralControl(" <BR> ");
                        spacer1000.ID = "spacer1000" + ViewState
["SessionNumber"];
                        PlaceHolder1.Controls.Add(spacer1000);
                        ViewState["placeHolder"]=PlaceHolder1; 
                        
                        //'Binding the page
                        Page.DataBind();

                }//end of function

                /// <summary>
        
        /// /////////////////////////////////////////////////////////
///////////////
                /// </summary>
                /// <param name="sender"></param>
                void addClick(System.Object sender , 
System.Web.UI.ImageClickEventArgs e )
                {
                        addControls(false);
                }

                /// <summary>
        
        /// /////////////////////////////////////////////////////////
////////////////
                /// </summary>
                /// <param name="sender"></param>
                /// <returns></returns>
                void deleteClick(System.Object 
sender ,System.Web.UI.ImageClickEventArgs  e )
                {
                        int currentDeleteIndex;
                        ImageButton ssss=(ImageButton)sender;
                        if (IsNumeric(myRight(ssss.ID, 2)) )
                        {
                                currentDeleteIndex = Int32.Parse
(myRight(ssss.ID.ToString(), 2));
                        }
                        else
                        {
                                currentDeleteIndex = Int32.Parse
(myRight(ssss.ID.ToString(), 1));
                        }//end if

                        //'deleting controls
                        LiteralControl spacer1  = (LiteralControl)
PlaceHolder1.FindControl("spacer1" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(spacer1);

                        DropDownList c  = (DropDownList)
PlaceHolder1.FindControl("c" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(c);

                        LiteralControl spacer2  = (LiteralControl)
PlaceHolder1.FindControl("spacer2" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(spacer2);

                        DropDownList s  = (DropDownList)
PlaceHolder1.FindControl("s" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(s);

                        LiteralControl spacer3  = (LiteralControl)
PlaceHolder1.FindControl("spacer3" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(spacer3);

                        TextBox t  = (TextBox)
PlaceHolder1.FindControl("t" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(t);

                        LiteralControl spacer4  = (LiteralControl)
PlaceHolder1.FindControl("spacer4" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(spacer4);

                        CheckBox a  = (CheckBox)
PlaceHolder1.FindControl("a" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(a);

                        LiteralControl spacer5  = (LiteralControl)
PlaceHolder1.FindControl("spacer5" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(spacer5);

                        ImageButton dsi  = (ImageButton)
PlaceHolder1.FindControl("dsi" + currentDeleteIndex);
                        if (! (dsi==null))
                        {
                                PlaceHolder1.Controls.Remove(dsi);
                        }//end if

                        LiteralControl spacer6  = (LiteralControl)
PlaceHolder1.FindControl("spacer6" + currentDeleteIndex);
                        if (!(spacer6==null) )
                        {
                                PlaceHolder1.Controls.Remove
(spacer6);
                        }//end if

                        LiteralControl spacer7 = (LiteralControl)
PlaceHolder1.FindControl("spacer7" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(spacer7);

                        ImageButton ns = (ImageButton)
PlaceHolder1.FindControl("ns" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(ns);

                        LiteralControl spacer1000 = (LiteralControl)
PlaceHolder1.FindControl("spacer1000" + currentDeleteIndex);
                        PlaceHolder1.Controls.Remove(spacer1000);

                        //'update the session number
                        ViewState["SessionNumber"] = Int32.Parse
(ViewState["SessionNumber"].ToString()) - 1;

                        //'update numbers
                        updateNumbers(currentDeleteIndex);

                        //'Binding the page
                        Page.DataBind();

                }//end of function
                        
                                
                void updateNumbers(int currentDeleteIndex )
                {
                        int u ;
                        if (currentDeleteIndex > Int32.Parse
(ViewState["SessionNumber"].ToString()) )
                        {
                                ImageButton ns1   = (ImageButton)
PlaceHolder1.FindControl("ns" + ViewState["SessionNumber"]);
                                ns1.Visible = true;
                                return;
                        }//end if;

                        for (int z = (currentDeleteIndex) ;z<= 
Int32.Parse(ViewState["SessionNumber"].ToString());z++)
                        {
                                u = z + 1;
                                LiteralControl spacer1  = 
(LiteralControl)PlaceHolder1.FindControl("spacer1" + u);
                                spacer1.ID = "spacer1" + (u - 1);

                                DropDownList c  = (DropDownList)
PlaceHolder1.FindControl("c" + u);
                                c.ID = "c" + (u - 1);

                                LiteralControl spacer2  = 
(LiteralControl)PlaceHolder1.FindControl("spacer2" + u);
                                spacer2.ID = "spacer2" + (u - 1);

                                DropDownList s  = (DropDownList)
PlaceHolder1.FindControl("s" + u);
                                s.ID = "s" + (u - 1);

                                LiteralControl spacer3  = 
(LiteralControl)PlaceHolder1.FindControl("spacer3" + u);
                                spacer3.ID = "spacer3" + (u - 1);

                                TextBox t  = (TextBox)
PlaceHolder1.FindControl("t" + u);
                                t.ID = "t" + (u - 1);

                                LiteralControl spacer4  = 
(LiteralControl)PlaceHolder1.FindControl("spacer4" + u);
                                spacer4.ID = "spacer4" + (u - 1);

                                CheckBox a  = (CheckBox)
PlaceHolder1.FindControl("a" + u);
                                a.ID = "a" + (u - 1);

                                LiteralControl spacer5  = 
(LiteralControl)PlaceHolder1.FindControl("spacer5" + u);
                                spacer5.ID = "spacer5" + (u - 1);

                                ImageButton dsi = (ImageButton)
PlaceHolder1.FindControl("dsi" + u);
                                if (! (dsi==null) )
                                {
                                        dsi.ID = "dsi" + (u - 1);
                                        dsi.Click+= new 
System.Web.UI.ImageClickEventHandler(deleteClick);
                                }//end if

                                LiteralControl spacer6 = 
(LiteralControl)PlaceHolder1.FindControl("spacer6" + u);
                                if (! (spacer6==null) )
                                {
                                        spacer6.ID = "spacer6" + (u -
 1);
                                }//end if

                                LiteralControl spacer7  = 
(LiteralControl)PlaceHolder1.FindControl("spacer7" + u);
                                spacer7.ID = "spacer7" + (u - 1);

                                ImageButton ns  = (ImageButton)
PlaceHolder1.FindControl("ns" + u);
                                ns.ID = "ns" + (u - 1);

                                LiteralControl spacer1000  = 
(LiteralControl)PlaceHolder1.FindControl("spacer1000" + u);
                                spacer1000.ID = "spacer1000" + (u - 
1);

                                //'show or hide the add image button
                                if (u == Int32.Parse(ViewState
["SessionNumber"].ToString()) )
                                {
                                        ns.Visible = true;
                                }
                                else
                                {
                                        ns.Visible = false;
                                }//end if
                        }//end of for

                        if ((currentDeleteIndex) >= Int32.Parse
(ViewState["SessionNumber"].ToString()) )
                        {
                                ImageButton ns1 = (ImageButton)
PlaceHolder1.FindControl("ns" + ViewState["SessionNumber"]);
                                ns1.Visible = true;
                                return;
                        }//end if

                }//end of function

                /// <summary>
        
        /// /////////////////////////////////////////////////////////
/////////////////////
                /// </summary>
                /// <returns></returns>
                int findBuild()
                {
                        //ReDim arrField(ViewState["SessionNumber"]);
                        //ReDim arrSearch(ViewState
["SessionNumber"]);
                        //ReDim arrValue(ViewState["SessionNumber"]);
                        //ReDim arrAnd(ViewState["SessionNumber"]);

                        //System.Web.UI.WebControls.WebControl ctl;
                        //PlaceHolder placeholder2 =(PlaceHolder)
Session["placeHolder"];

                        
                        


                        for (int i = 0 ; i<=
(PlaceHolder1.Controls.Count - 1);i++)
                        {
                                int currentIndex;

                                //'know if the search item is one 
digit or 2 digits
                                if (IsNumeric(myRight
(PlaceHolder1.Controls[i].ID, 2)) )
                                {
                                        currentIndex = Int32.Parse
(myRight(PlaceHolder1.Controls[i].ID.ToString(), 2));
                                }
                                else
                                {
                                        currentIndex = Int32.Parse
(myRight(PlaceHolder1.Controls[i].ID, 1));
                                }//end if

                                //'check the type of the control and 
assign it to its array variable
                                if (PlaceHolder1.Controls[i]  is 
TextBox)
                                {
                                        //'t
                                        string[] arrValue_tmp = new 
string[currentIndex+1];
                                        arrValue.CopyTo
(arrValue_tmp,0);
                                        arrValue_tmp[currentIndex]=
((TextBox)(PlaceHolder1.Controls[i])).Text;
                                        arrValue=arrValue_tmp;
                                }
                                else if (PlaceHolder1.Controls[i] is 
DropDownList )
                                {
                                        //'c or s
                                        if (myLeft
(PlaceHolder1.Controls[i].ID, 1) == "c" )
                                        {
                                                string[] 
arrAlias_tmp = new string[currentIndex+1];
                                                arrAlias.CopyTo
(arrAlias_tmp,0);
                                                arrAlias_tmp
[currentIndex] = ((DropDownList)(PlaceHolder1.Controls
[i])).SelectedItem.Text;
                                        
        arrAlias=arrAlias_tmp;

                                                string[] 
arrField_tmp = new string[currentIndex+1];
                                                arrField.CopyTo
(arrField_tmp,0);
                                                arrField_tmp
[currentIndex] = ((DropDownList)(PlaceHolder1.Controls
[i])).SelectedItem.Value;
                                        
        arrField=arrField_tmp;
                                        }
                                        else //'s
                                        {
                                                string[] 
arrSearch_tmp = new string[currentIndex+1];
                                                arrSearch.CopyTo
(arrSearch_tmp,0);
                                                arrSearch_tmp
[currentIndex] = ((DropDownList)PlaceHolder1.Controls
[i]).SelectedItem.Text;
                                        
        arrSearch=arrSearch_tmp;
                                        }//end if
                                }
                                else if ( (PlaceHolder1.Controls[i]) 
is CheckBox )
                                {
                                        //'a
                                        bool[] arrAnd_tmp = new bool
[currentIndex+1];
                                        arrAnd.CopyTo(arrAnd_tmp,0);
                                        arrAnd_tmp[currentIndex] = 
((CheckBox)(PlaceHolder1.Controls[i])).Checked;
                                        arrAnd=arrAnd_tmp;
                                }//end if

                        }//end of for

                        ///Label2.Text = " ";
                        for (int k = 1 ;k<= Int32.Parse(ViewState
["SessionNumber"].ToString());k++)
                        {
                                ///Label2.Text += "***" + arrAnd[k];
                                if (arrValue[k] == "" && k != 1 )
                                {
                                        _responseResult 
+= "</Result>";
                                        return 0;
                                }
                                else
                                {
                                        if (searchBuilder(k) == 
false) //'may be the user is using wildcards without checking the 
allow wildcards option
                                        {
                                                _responseResult 
+= "</Result>";
                                                return 1;
                                        }//end if
                                }//end if
                        }//end of for

                        _responseResult += "</Result>";
                        return 2;
                }//end of function

                /// <summary>
        
        /// /////////////////////////////////////////////////////////
//////
                /// </summary>
                /// <param name="cIndex"></param>
                /// <returns></returns>
                bool searchBuilder(int cIndex)
                {
                        bool fullSearch = false;

                        //Dim sr As StreamWriter = File.CreateText
(file_path)
                        //sr.WriteLine("<?xml version=""1.0"" 
encoding=""UTF-8""?><?mso-infoPathSolution 
solutionVersion=""1.0.0.99"" productVersion=""11.0.6250"" 
PIVersion=""1.0.0.0"" href=""" & MEP_Form.PublishURL & """ 
name=""urn:schemas-microsoft-com:office:infopath:MEP-Formv1-9:-myXSD-
2004-03-24T08-18-21"" ?><?mso-application 
progid=""InfoPath.Document""?><?mso-infoPath-file-attachment-present?
>")
                        //sr.WriteLine(MEP_FormXML.xmlstring)
                        //sr.Close()
                        if (cIndex == 1 )
                        {
                                _SearchString ="<?xml version=\"1.0
\" encoding=\"UTF-8\"?>\r\n<Result>";
                                //_SearchString 
+= "<SearchResult>\n";
                                //_SearchString = "SELECT * FROM " + 
_TableName + " WHERE ";
                                if (arrValue[cIndex] == "" )
                                {
                                        fullSearch = true;
                                }
                        }//end if
                        else
                        {
                                if (arrAnd[cIndex - 1] == true)
                                {
                                        _SearchString += "<AND>";
                                        _SearchString += "true";
                                        _SearchString 
+= "</AND>\r\n"  ;
                                        //_SearchString += " AND ";
                                }
                                else
                                {
                                        _SearchString += "<AND>";
                                        _SearchString += "false";
                                        _SearchString 
+= "</AND>\r\n";

                                        //_SearchString += " OR ";
                                }//end if
                        }//end if


                        if (fullSearch == true )
                        {
                                //_SearchString += " 1=1 ";
                        }
                        else
                        {
                                if (chkAllowWildcards.Checked == 
false)
                                {
                                        if (arrValue[cIndex].ToString
().IndexOf("%") != -1 || arrValue[cIndex].ToString().IndexOf("^") !
= -1 || arrValue[cIndex].ToString().IndexOf("_") != -1 || arrValue
[cIndex].ToString().IndexOf("[") != -1 || arrValue[cIndex].ToString
().IndexOf("]") != -1 )
                                        {
                                                return false;
                                        }//end if
                                
        _SearchString+="<SearchResults>" ;
                                        _SearchString+="<Field>" ;
                                        _SearchString+=arrField
[cIndex] ;
                                
        _SearchString+="</Field>\r\n" ;
                                        _SearchString+="<Criteria>" ;
                                        _SearchString+=arrSearch
[cIndex] ;
                                
        _SearchString+="</Criteria>\r\n" ;
                                        _SearchString+="<Value>" ;
                                        _SearchString+=arrValue
[cIndex] ;
                                
        _SearchString+="</Value>\r\n" ;
                                        _SearchString+="<Alias>" ;
                                        _SearchString+=arrAlias
[cIndex] ;
                                
        _SearchString+="</Alias>\r\n" ;
                                
        _SearchString+="<AllowWildCards>" ;
                                        _SearchString+="false" ;
                                
        _SearchString+="</AllowWildCards>\r\n" ;
                                        _SearchString 
+= "</SearchResults>\r\n";

                                        //                      
                switch(arrSearch[cIndex])       
                                        //                      
                        {         
                                        //                      
                        case "Begins with":
                                        //                      
                                _SearchString += arrField[cIndex]+ " 
like '" + arrValue[cIndex] + "%' ";
                                        //                      
                                break;
                                        //                      
                        case "Contains":
                                        //                      
                                _SearchString += arrField[cIndex]+ " 
like '%" + arrValue[cIndex] + "%' ";
                                        //                      
                                break;
                                        //                      
                        case "Ends with":
                                        //                      
                                _SearchString += arrField[cIndex]+ " 
like '%" + arrValue[cIndex] + "' ";
                                        //                      
                                break;
                                        //                      
                        case "is exactly":
                                        //                      
                                _SearchString += arrField[cIndex]+ " 
= '" + arrValue[cIndex] + "' ";
                                        //                      
                                break;
                                        //                      
                        case "is empty":
                                        //                      
                                _SearchString += arrField[cIndex]+ " 
IS NULL ";
                                        //                      
                                break;
                                        //                      
                        case "is not empty":
                                        //                      
                                _SearchString += arrField[cIndex]+ " 
IS NOT NULL ";
                                        //                      
                                break;
                                        //                      
                        //default:            
                                        //                      
                                //Console.WriteLine("Invalid 
selection. Please select 1, 2, or 3.");            
                                        //                      
                                //break;
                                        //                      
                        } //switch
                                }//for if added
                                else //'use of wildcards is enabled
                                {
                                        //_SearchString += arrField
[cIndex] + " like '" + arrValue[cIndex] + "' ";
                                
        _SearchString+="<SearchResults>" ;
                                        _SearchString+="<Field>" ;
                                        _SearchString+=arrField
[cIndex] ;
                                
        _SearchString+="</Field>\r\n" ;
                                        _SearchString+="<Criteria>" ;
                                        _SearchString+=arrSearch
[cIndex] ;
                                
        _SearchString+="</Criteria>\r\n" ;
                                        _SearchString+="<Value>" ;
                                        _SearchString+=arrValue
[cIndex] ;
                                
        _SearchString+="</Value>\r\n" ;
                                        _SearchString+="<Alias>" ;
                                        _SearchString+=arrAlias
[cIndex] ;
                                
        _SearchString+="</Alias>\r\n" ;
                                
        _SearchString+="<AllowWildCards>" ;
                                        _SearchString+="true" ;
                                
        _SearchString+="</AllowWildCards>\r\n" ;
                                        _SearchString 
+= "</SearchResults>\r\n";

                                }//endif
                        }//endif

                        ///Label1.Text = _SearchString;
                        _responseResult = _SearchString;
                        
                        return true;
                }//end of function


                #region Web Form Designer generated code
                override protected void OnInit(EventArgs e)
                {
                        //
                        // CODEGEN: This call is required by the 
ASP.NET Web Form Designer.
                        //
                        InitializeComponent();
                        base.OnInit(e);
                }
                
                /// <summary>
                ///             Required method for Designer 
support - do not modify
                ///             the contents of this method with the 
code editor.
                /// </summary>
                private void InitializeComponent()
                {
                        this.Load += new System.EventHandler
(this.Page_Load);

                }
                #endregion
                /// <summary>
        
        /// /////////////////////////////////////////////////////////
//////////////////
                /// </summary>
                /// <param name="sender"></param>
                /// <param name="e"></param>
                public void Find()
                {
                
        /////////////////////////////////////////////////////////////
///////////////////////
                        int checkResult ;
                        checkResult = findBuild();
                        if (checkResult == 2)
                        {
                                //''''''Label1.Text = _SearchString
                                //'Do the datagrid and sql 
manipulation
                        }
                        else
                        { 
                                if (checkResult == 0 ) // 'empty 
value
                                {
                                        lblError.Visible = true;
                                        lblError.Text = "You did not 
fill all search values.";
                                }
                                else 
                                {
                                        if (checkResult == 
1 )//'using wildcards without checking the option
                                        {
                                                lblError.Visible = 
true;
                                                lblError.Text = "You 
are using wildcards in your search criteria, but you did not check 
the 'allow the use of wildcards' option. Please check this option or 
remove any wildcards from your search criteria.";
                                        }//end if

                                }
                        }

                
        /////////////////////////////////////////////////////////////
///////////////////
                }
        }

}


-----------x-----------------x---------------------x-----------------

> On Wed, 13 Oct 2004 17:54:50 -0000, amogh79 <[EMAIL PROTECTED]> wrote:
> >  
> >  Hi All,
> >  
> >  Will any one help me how wilsons web form can be used in the 
> >  following exisitng scenario:
> >  
> >  Currently I am having a user control which has a place holder 
which 
> >  contains literal,textbox,dropdownlist,checkbox and a image 
button.
> >  In current scenario when i try to add the place holder to 
viewstate 
> >  i get error due to use of asp net state server being in use.
> >  I was suggested by Charles to use wilson web form control, pls 
guide 
> >  me how i can use Wilson's web form control in this scenario.
> >  A sample code with placeholder control will be more useful
> >  
> >  With regards
> >  Amogh
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  Yahoo! Groups Sponsor 
> >  
> >  ADVERTISEMENT
> >  
> >  
> >  ________________________________
> >  Yahoo! Groups Links
> >  
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
> >   
> > To unsubscribe from this group, send an email to:
> > [EMAIL PROTECTED]
> >   
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to