change form action from aspx page to master page behind it - forms

i have a master page and a child aspx page, coneected to each other. the master page has the form in it. Now the child page has checkboxes, whose value i would like to pass to another child page with same master page behind it.
Can i change the action=abc.aspx and method=post?
How can i send all the checkbox values (checkbox.text = abc#oke.com) to the next page?
there are lots of these values that need to pass to nex tpage.

Use Button.PostBackUrl to change the page which the button posts to, and then on the target page, use Page.PreviousPage to get a reference to the source page (and therefore its controls).
By default you can use Page.PreviousPage.FindControl(...) to find a control on the source page by ID, then cast it to a checkbox and retrieve its values. You can also specify the type of the previous page with a <%# PreviousPageType %> directive, and then access the previous page's public properties.
See Cross-Page Posting for details.

Related

Pass reference id from url bar to other internal pages

I am compiling a lead generation landing page and, in the form I have inserted a hidden field which collect whatever is written in the url bar after
"?rel=".
This is done in order to track where the leads come from (Facebook ads, direct linking etc).
To be more clear if this is the url: www.mywebsite.com/form.html?rel=fbads
the hidden field will be fill with "fbads" and this is working.
In the landing page I have a link to another page with more details and in this webpage I have the same form.
My idea is to run campaings on the first page with the rel link, but then if the user clicks on the link and go to the detailed page (and then compile the form from there), I am losing the rel field.
How can I pass the rel field to the url of the second page?
Thanks
You may refer the this stackoverflow page. Once the HTTP GET request comes, traverse in HTTP headers in your controller and look for Referer field but it is not always set and the client can change the header value. May be using google analytics is the better option.
If you just want to know that whether if they came to your form page from your landing page or not, you may add fix HTTP URL parameter prior to HTTP redirect.
If you save your rel in a variable, you can add it on your link to detailed page, for example in case of =fbads just once variable is set up, add it: <a href="http://myDetailedPage.com/detailed/?=<?php $rel;?>"</a>

Prevent Component reloading - AEM

I have 2 pages in my web application. Lets say an home page and news feed page. When user clicks a hyperlink on home page then she/ he gets redirected to News feed page. I have 2 separate components in each page like
Home Page --- Header Component & Home Page Details Component.
News Feed Page --- Header Component & News Feed Details Component.
Both the pages has a common component Header. Can I prevent component reloading for the header component when users reaches the second page by clicking link on the first page.
By component reloading I mean the HTML code (HTL) code in the component should not be updated again with updated data instead for the second page, I just want to show the same data associated with header component in the first page.
A new page will always be loaded as a whole, because of just how [HTML] page loads work. What you are looking for is a single page application. They are possible with AEM but are a pain to design, especially the authoring mode behaviour.
This is a very common HTML pattern and possible duplicate of related questions such as: How to auto refresh a section of a page
There are two general approaches, the first being far preferred and supported in various frameworks, all based on JavaScript (AJAX):
Break page into different DIV tags that are independently updated (header separate from body sections, each loaded via AJAX such that only part of the page that has changed is updated).
Use iFrames such that effectively there are different pages - each loaded separately from the other.

Sharing a public render parameter value across pages

I am using a Public Render Parameter in WebSphere Portal.
http://www-01.ibm.com/support/knowledgecenter/SSHRKX_8.5.0/mp/dev-portlet/pltcom_pubrndrprm.dita
Using the Web Content Viewer portlet.
I've created 2 separate pages on Portal, each one containing a Web Content Viewer portlet.
Each page reads the value of CUSTOM_CONTEXT and displays it if a value has been set.
If a value has not been set yet, it displays a textfield and submit button, allowing user to provide a string.
When I set the value of CUSTOM_CONTEXT to the string TEST on page 1, the page reloads and TEST is displayed back to me.
However, when I navigate to page 2, I still see the textfield?
As though the value has not been set for that page.
How can I have the value shared across all pages?
If I navigate back to page 1, the value is still store as TEST.
http://www-304.ibm.com/support/knowledgecenter/SSHRKX_8.5.0/mp/dev-portlet/pltcom_pubrndrprm.dita
"For some use cases, it can be required to limit parameter sharing. For example, this case can occur if you have two pairs of navigator or viewer portlets on two different pages, where each pair must be coordinated. However, the pairs must not interfere across pages so that the navigator on the first page does not influence the viewer on the second page. For such cases, the portal makes it possible to limit the sharing scope for public render parameters on a page basis. The parameter sharing scope for a page is controlled by a page parameter param.sharing.scope. You can set it from the Page Properties view under Advanced options > I want to set parameters. If you set a value for this parameter, portlets on the page share their public render parameters only with other portlets on the same page or on pages with the same scope."

xPages-Notes-redirection-pagination : how to redirect to a certain page number of a paginated view?

I have a classical xPage with view panel (in a custom control) linked to a paginated view, which displays records.
I have more than one page to display. Each one has a key column defined as a link which sends the document to a form edition page.
Then in this page I update the record clicking a 'Save button' which redirects the user to the original view page (which URL has been stored in the sessionScope).
The problem is that it redirects to the first page and not the one which contained the record.
How can I specify the page number to display when coming back to the view page ?
I had to do something similar for one of my applications and instead of using the simple action to redirect to the XPage I used the context.redirectToPage which allowed me to pass the sessionScope variable I had stored with the below code.
var url:XSPUrl;
URL = context.getUrl();
sessionScope.put('your scope name',#RightBack(url.getPath().toString(),"/"));

Facebook like button on a product page

My requirement is to integrate my client webpage and facebook using the Flike button.
I have an html page which is used for all the products. Based on the product code selected, the content in the page changes. The URL format is something like this -
in the browser it shows : http://xyz.com/product.aspx,
in the view source, in the action attribute of the form tag : ../../product.aspx?prdcode=123&catcode=3453
Now, my requirement is to place an flike button on this page. I have tried doing it in several ways... but the issue is:
If I click on flike button on one page.. the button is disabled for every other product.
Not sure what all needs to be included in to get this functionality right.
For a product listing page you'd need to have multiple like buttons, each pointing at a URL which represents an individual product - each of those pages needs the appropriate open graph meta tags, include the JS SDK once on your listing page, and have multiple <fb:like tags pointing at the individual product URLs
If the page content is dynamic, I think you can do the same, but you'll need to remove and add the like button as the content changes