1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Need help on using ascx pages in sitefinity

Need help on using ascx pages in sitefinity

3 posts, 2 answered
  1. Shilpa Reddy
    Shilpa Reddy avatar
    2 posts
    Registered:
    15 Jan 2010
    11 May 2010
    Link to this post
    Hi There!

    I have sucked when i am using .ascx pages on sitefinity, if you can help me it would be great. Please see the description of my issue below.

    1.  I have a header control header.ascx, footer control footer.ascx and a main content like AdminScorecard.ascx page. 
    2.  can you please tell me how i need to arrange all three controls on a single page.
    3.  In my AdminScorecard.ascx page i have a button when i click on that button it should redirect to another page. Could you please tell me how i need to do this (in .net we write Response.Redirect(Home.aspx). In sitefinity how i need to do this.
    4.  how i need to pass the values through query string, cookies. 


    Please help me with the above things.



    Thank You,
    --Neelima
  2. George
    George  avatar
    204 posts
    Registered:
    05 Sep 2006
    11 May 2010
    Link to this post
    Hi Neelima,

    Working with ascx and sitefinity is very straightforward once you know the exact things to do to make it work.

    1.  I have a header control header.ascx, footer control footer.ascx and a main content like AdminScorecard.ascx page.  
    2.  can you please tell me how i need to arrange all three controls on a single page.

    What I suggest is that you create a master page for your pages and place all these controls unto your template page or if you prefer adding them to every single page then go ahead.

    But to start you should have a template having a content place holder such as 

    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" />

    then when you select this template you will be able to add your ascx controls to this place holder.

    To add your controls to the page, you can do it in 2 ways:

    1- Uploading your control in sitefinity Add Controls Panel then Upload Control 
    or 
    2- modify the web.config 

    <toolboxControls>
    <clear/>
    <add name="ControlName" section="My Controls" type="Full Qualified Name, Assembly Name"/>

    3.  In my AdminScorecard.ascx page i have a button when i click on that button it should redirect to another page. Could you please tell me how i need to do this (in .net we write Response.Redirect(Home.aspx). In sitefinity how i need to do this. 

    You need to create this type of controls in visual studio and add code behind to it with the Response.Redirect on button click then upload your control as i stated before.

    4.  how i need to pass the values through query string, cookies.  

    Same as point 3. 

    Hope this helps,

    Cheers
    Answered
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    11 May 2010
    Link to this post
    Hello Shilpa Reddy,


    1.  I have a header control header.ascx, footer control footer.ascx and a main content like AdminScorecard.ascx page. 
    2.  can you please tell me how i need to arrange all three controls on a single page.

    Create a master page with three ContentPlaceHolders and drop each of the

    3.  In my AdminScorecard.ascx page i have a button when i click on that button it should redirect to another page. Could you please tell me how i need to do this (in .net we write Response.Redirect(Home.aspx). In sitefinity how i need to do this.

    You should have a user control with the above mentioned logic that makes Response.Redirect.

    4.  how i need to pass the values through query string, cookies.

    You could use user or custom controls where you manage the QueryString and Cookies data


    For some custom base implementations you could override the behavior of InternalPage

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Answered
Register for webinar
3 posts, 2 answered