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

Forums / Developing with Sitefinity / Extensionless url and postback problems

Extensionless url and postback problems

10 posts, 0 answered
  1. Systeembeheer UNIT4
    Systeembeheer UNIT4 avatar
    12 posts
    Registered:
    17 Nov 2008
    12 Jun 2009
    Link to this post
    Hi,

    We've set up sitefinity Extensionless url using the sf404 page.
    Now we're having problems with usercontrols that do postbacks (for instance a contact form) on the page when it is requested without the extension .aspx.
    The page reloads, but the click events are never triggered.

    I already found some other posts on similar problems in the forums, but I haven't found a good solution for this problem.
    We also tried to set the postbackurl, of the button doing the postback, to the page with .aspx extension but that didn't help either.


    Kind regards,

    Rob Houweling
  2. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    17 Jun 2009
    Link to this post

    Hi Rob,

    Actually, in Sitefinity 3.6 we have already addressed this problem.

    In case you are using sf404.aspx approach for extensionless URLs, Sitefinity adds sf404.aspx extension to the value of the form action attribute in the page output.

    For example, if you request the following URL

    http://localhost/index?cmspagemode=edit

    you should have the following HTML in the page View Source:

    ...
    <form name="aspnetForm" method="post" action="index.sf404.aspx?cmspagemode=edit" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">
    ...

    Then,  if you do a postback, the page will be requested with the following URL:

    http://localhost/index.sf404.aspx?cmspagemode=edit

    Alternatively, instead of sf404.aspx method, you can use wildcard mapping to accomplish extensionless URLs.

    Hope this is helpful.


    Sincerely yours,

    Vlad
    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. Justin Beitlich
    Justin Beitlich avatar
    3 posts
    Registered:
    11 Mar 2009
    02 Jul 2009
    Link to this post
    What do I need to do to set this up?  All we want to do is have a page that has contactus.aspx be accessed from contactus only.

    Help!
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    06 Jul 2009
    Link to this post
    Hello Justin Beitlich,

    As my colleague said in the previous post, Sitefinity 3.6 supports the scenario you have - extensionless url and a form doing a postback. You can check if you are running the latest version, and if the action attribute looks like mentioned in the previous post.

    Can you please follow up with these details?

    Sincerely yours,
    Georgi
    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.
  5. Jay Mehta
    Jay Mehta avatar
    28 posts
    Registered:
    30 Jun 2009
    18 Aug 2009
    Link to this post
    Hi,

    This is not about Extensionless url, but it is about the Forms. I want to perform an action on the form submit.
    I want to add..
    <form name="survey" action="http://lists.usgbc.org/subscribe/survey_save" method="POST">
    

    When I create my form in the generic content, I want to add this action and method in the forms tag. Any idea on how I can achieve that? I added the above line in the generic content, but sitefinity somehow is removing this action attribute, and is using the default form tag for the whole page.

    Thank you,
    Jay Mehta.
  6. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    18 Aug 2009
    Link to this post
    Hi Jay Mehta,

    Actually, ASP.NET require only one <form> tag on the page in order to work properly.
    Please read the following KB for a work around:
    http://www.sitefinity.com/support/kb/sitefinity-3-x/more-than-one-form-tag-causes-sitefinity-to-crash.aspx

    Greetings,
    Vlad
    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.
  7. Jay Mehta
    Jay Mehta avatar
    28 posts
    Registered:
    30 Jun 2009
    18 Aug 2009
    Link to this post
    Hi,

    Thank you for the quick reply. I can convert the form into a user control, but how do I perform the action and POST on the submit. Any ideas or articles on that?

    Thank you,
    Jay Mehta.
  8. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    18 Aug 2009
    Link to this post
    Hi Jay Mehta,

    In the user control, you have to add <IFRAME> by specifying _parent as a target attribute. You should link the IFRAME element to another .aspx page. and implement the action logic in that page.

    Hope this is helpful.

    All the best,
    Vlad
    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.
  9. Jay Mehta
    Jay Mehta avatar
    28 posts
    Registered:
    30 Jun 2009
    18 Aug 2009
    Link to this post
    Hi,

    Thank you again.
    I am sorry I am asking you to spoon feed me on this issue, but I am new into programming. Do you have any article, which does that, or a sample in the code library. This would be very helpful.

    Thank you,
    Jay Mehta.
  10. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    18 Aug 2009
    Link to this post
    Hello Jay Mehta,

    Actually, there is nothing Sitefinity related in this implementation.
    Everything else, that is not mentioned in the previous post depends on the specific scenario.

    Here are some links:
    http://msdn.microsoft.com/en-us/library/y6wb1a0e.aspx
    http://www.w3schools.com/TAGS/tag_iframe.asp



    Sincerely yours,
    Vlad
    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
10 posts, 0 answered