More in this section

Forums / Developing with Sitefinity / Redirect to a custom page

Redirect to a custom page

4 posts, 0 answered
  1. subodh
    subodh avatar
    24 posts
    Registered:
    25 Mar 2009
    12 May 2009
    Link to this post
    Hi,

    I stuck with a problem here is a detailed explanation

    we are using a blog module for a case studies(Part of our project)
    The requirement is when user wants to download the case study or when he clicks on the link(fullstory) he has to be redirected to a contact form(user control) where he enters the details and he is redirected to the case study page(full story page) for the download.

    we are using the contentviewitemlist.aspx template for the casestudy.
    Now the problem  in the contentviewitemlist.aspx is, when user clicks on any of the full story link we need to redirect him to the contactform.aspx with URL of actual full story page in the form of query string.
    for this we are using

      protected void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.DataItem != null)
            {
                CmsContentBase cmscontentbase = new CmsContentBase();
                cmscontentbase = (CmsContentBase)e.Item.DataItem;
                cmscontentbase.UrlWithExtension = "/BeckDRWeb/ContactForm.aspx";
                        
                
            }
        }

    In the above code on repeater's data item data bound we are trying to change the default URL(which is of full blog content page) to a contactform.aspx but as UrlWithExtension is having only the get not the set we cannot assign any custom url to it

    So The question is
    HOW TO SET THE UrlWithExtension with the custom url like(/BeckDRWeb/ContactForm.aspx)

    or we tried with the
    cmscontentbase.Url = "/BeckDRWeb/ContactForm.aspx";
    but we are getting an error that is

    "You cannot change a value of an object that is not in transaction."

    so any suggestions.

    Thanks
    Subodh.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    12 May 2009
    Link to this post
    Hello subodh,

    The requirement is when user wants to download the case study or when he clicks on the link(fullstory) he has to be redirected to a contact form(user control) where he enters the details and he is redirected to the case study page(full story page) for the download.

    Here is a sample that demonstrates how you can achieve this approach.

    1. You should have a BlogPosts control on a page which has full story link
    2. Custom Page with your form - where I am adding an "Submit" button

    In the template I am changing the hyperlink controls to an a href ( the problem is that the value of the HyperLink will be overridden from ContentView control even we set a value0

    <class="sf_readMore"
                    <href='BlogForm.aspx?BlogPostID=<%# Eval("ID") %>'
                        <asp:Literal ID="LiteralFS" runat="server" Text="<%$Resources:FullStory %>"></asp:Literal> 
                    </a> 
                </p> 

    Here are are binding to the ID of the item we have selected and adding a href value to our BlogForm page.

    In our BlogFrom page we are getting teh Icontent by the QueryString BlogPostID
            // add your form logic here 
            ContentManager manager = new ContentManager("Blogs"); 
            IContent blogPost = manager.GetContent(new Guid(Request.QueryString["BlogPostID"])); 
            string url = "YOUR_DOMAIN_PATH_GOES_HERE" + blogPost.UrlWithExtension; 
            Response.Redirect(url); 
          

    Finally we are returning user to the full story page or another one.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. subodh
    subodh avatar
    24 posts
    Registered:
    25 Mar 2009
    18 Jun 2009
    Link to this post
    hi,

    and thanks for the reply it worked.

    I have another question regarding the radupload control

    I am using a radupload control in my application.when user clicks on textbox or the select button a dialog box opens to upload a file.

    The problem is suppose user has selected one file from the file dialog and immediatedly he doesn't want to upload the same selected file.how should he remove the file name from the textbox of radupload?

    It seems the textbox of radupload  is made readonly how to make it editable.

    Thanks
    Subodh.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Jun 2009
    Link to this post
    Hello subodh,

    It is a problem of RadUpload control. As a workaround you could set EnableFileInputSkinning property to false. This will allow you to edit the text in the texbox.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered