Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to add controls to Content Search WebPart

$
0
0

I created  a webpart inherits ContentBySearchWebpart, in this webpart i added a textbox and a button.

By default, the textbox and the button are below the content search webpart, how to move them to the top?

Please help...

Here are my code:

public class CustomSearch : ContentBySearchWebPart

 protected override void CreateChildControls()
        {
            TextBox tb = new TextBox();
            tb.ID = "tbProjectName";

            Button bt = new Button();
            bt.ID = "btSubmit";
            bt.Text = "Submit";
            bt.Click += bt_Click;

            Controls.AddAt(0,tb);
            Controls.AddAt(1,bt);


            base.CreateChildControls();

        }



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>