Read value from one aspx page to another - user-controls

i have two pages: 1) web control(ascx page) and 2) web page(aspx page without master page).
Now i calculate some values on page2 through google api through Javascript on render, and i need to transfer these values to page 1 in a hidden field through code. please help
Khushi

One way (of many):
On the Client side: Fill the hidden
field, submit the form (with js)
Code Behind
Page 2: Collect the data in the code
behind, Populate the session,
Response.Redirect to page 1
Another:
Without using the the hidden field, you could
just append the calculation result to
the query string. (/page.aspx?myResult=xy)

Obvious, quick answer: use querystring or Session object.

Related

Kentico V9 Confirm form submission with javascript history.back

My repeater has enough data where I see my pagination. When I view the detail transformation for any items after the first page, the history.back() button gives me the form submission error.
Short of hard coding the back button, what's the easiest solution to avoid this?
I assume the "history.back()" is your javascript? The pagination is most likely occurring through postback, and any navigation back will require that same post data being sent.
One option is you can make the pagination not postback, but instead URL based. In the "Paging" area of your repeater, set the Mode to "QueryString" and set a querystring key (like "page"). Try that!
Otherwise you will need to do a window.location = "/The/Previous/Url" so it won't event attempt a postback and will simply direct them to the page, but your page you were last on will be lost.
Wrap the webpart in an update panel. In the webpart you can check the box to do this very easy and leave the rest of your configurations the way they are. If other elements on the page require a postback or rely on that webparts values then you may have to wrap all of them in an update panel.

In XPages Mobile App / Mobile Control, how to make picklist

I have two pages, one page for input, another page for the options, how to send value form page to another page on xPages Mobile Controls, or is there another way to make like this.
See my sample page:
1. Page 1:User Input
http://i1248.photobucket.com/albums/hh490/dannysumarnach/page_1_form_user_input.jpg
Page 2:Picklist
http://i1248.photobucket.com/albums/hh490/dannysumarnach/page_2_user_choice_PickList.jpg
note: the built-in typeahead not posible
Regards,
Danny
The in built type ahead is missing the dojo tundra.css file when using the single page app control. This file comes with Dojo its just not being included. Import this file to get the type ahead to work.
I'm unsure as to what you mean about passing value from one page to another, you can submit data to a document and open it in another page, add it to a scoped variable, add a parameter to the URL. All of these options will work.
Have a look at my blog post on this topic. There are a couple of gotchas to get around, most notably, ensuring the the page with your document datasource gets recalculated at the correct time. I'm working on a NotesIn9 on it.
Part 3 covers a couple of amendments to get it working with existing documents and includes a sample page that will work in the Extension Library Demo db. Note the extra view that needs to be created and other details in Part Two.
http://www.intec.co.uk/xpages-mobile-controls-and-value-pickers-part-three-client-side-approach-extended/

Automatically open document when only one document is listed in repeat control

I have a repeat control for a domino view which displays the results from a search field.
As you type more characters into the search field the number of items in the list is reduced. If/When the the list only contains a single item I would like to open item automatically, without having to click the link.
Any ideas are appreciated.
Edit: after some very interesting responses, here are some screenshots
I have 3 elements on the page, a searchbar, a repeat control and a form:
When I start typing in the search bar, the repeat is refreshed with every keystroke:
the list is reduced, typing the next character ...
again the list is reduced, only 2 left, typing again....
Only one left, now it would be time to open the document in the form ..... without clicking the link.
I've tried several events on the page, but it seems that I could not find the one that will allow me to "select" the document and display the data in the form.
It seems that it's not as simple as I thought
Since you want to open the link automatically I don't know if I would try to base it on the getRowCount() of the repeat itself. You don't want to even get that far right? you just want to go to the single document.
I would put a function in beforePageLoad event maybe. Not totally sure which event but I'd try that first. Use SSJS and do a lookup that would basically return a collection of what the repeat would show. If the collection count = 1 then get your destination from that entry and do your redirection from there.
That what I would try at least. Interesting scenario!
Now that I see the screenshots this might be easier then you think and I have already implemented something similar on an internal application that I have built. It does rely on the fact that each entry in the list is 100% unique.
First of all you will need to bind the search field to a scoped variable and the onchange/onkeypress event will need to perform a partial refresh of a panel that contains both the list and the document portion of the page.
For the list the link on each item should set the value of the same scoped variable used in the search box and clicking the link should be set to run a partial refresh of the document area.
For the document area you will need two panels, the first panel will only display if there is no matching document and the second panel will only display if there is a matching document, you can do this in the rendered section by writing some ssjs that grabs a handle to the db/view and does a dblookup and returns either true or false if the document exists depending on panel your dealing with.
With this setup, when somebody clicks a link or fills out the searchbox the scoped variable will contain a value, the document panels will then check to see if this is a unique value in the view in the db and update themselves to either display the 'no document' panel or the 'document' panel accordingly.
You could add a evaluation script to the entry of your repeat control which checks the size of your repeat control using the method getRowCount() from the component. If this is 1 you could execute a context.redirectToPage("yourpage.xsp?id=yourid",true) this forces the current page to send a redirect request back to the browser and therefore redirects you to the correct page.
All you need to know is which xpage you need to open and which parameters you should use. But these could be retrieved from the content you are iterating over.

SharePoint Dataform webpart redirection issue

I have two web parts in my sharepoint aspx web page. One is Content editor web part and the other is data form web part.
In data form web part, I have a data view and I need to pass a parameter "id" to this dataview which will show the project details in the data view. I tried to use a value from a control as a parameter and never had a success. I did googled a lot last few days and haven't found any solution. It would be great, if someone show me a way to use the text from a control (may be a text box or select control). if someone have a working sample, please share. Alternatively I have used a query string as a parameter (eventhough I prefer to use text from a control). We need to pass a query string called id. For example, I am navigating to http://localhost/pages/1.aspx?id=7. This will show the project details of project id 7 in data form web part. this works fine.
I need to provide an option to user to enter the project id instead of modifying the query string in url. To achieve that I used content editor web part and I have a text box text1 and a submit button (html controls). The user will enter project id in the text box provided and will click the submit button to view the project details in dataview. The submit button javascript code has the following code:
url = 'http://localhost/pages/1.aspx?id=7';
alert (url); //alerts as http://localhost/pages/1.aspx?id=7
window.location = url;
For testing purpose, I just hardcoded the url. However, clicking the submit button is not redirecting to http://localhost/pages/1.aspx?id=7 or something happens during redirect. The page just reloads once. i.e., if I am in http://localhost/pages/1.aspx?id=12 and clicking the submit button reloads the page http://localhost/pages/1.aspx?id=12 instead of navigating to http://localhost/pages/1.aspx?id=7.
Without data form web part, the redirect works fine. Kindly help.
Thank you

how to hide querystring in asp.net content page?

i have master-content page scenario.I have a link button on content page. that redirects to other page. but with redirection it carrying the parameters. I want to hide this querystring parameters .I tried with POST() in Form tag of master page . but that does not affecting. What have to do ?
There are many ways to carry values from one page to the next. You could store the values in some Session type container, or add them as hidden fields.
If you want a ugly way, you could use a good old frameset.
POST is the answer, but we'll need some code to help more effectively

Resources