Seam conversation - seam

I am trying to create a form with 3 drop downs and a text area. I am using conversation as scope. I end the conversation when user click on submit button. The problem that I am facing is back button issue. When back button is clicked, previous data is remembered. If I try to select from a drop down, I get a message that conversation has ended. Is there a way I can just reload the page from scratch? So, users can submit a new request?

You need to create where to redirect a conversation in the pages.xml configuration file scratch
<pages>
<page view-id="/youfile.xhtml" no-conversation-view-id="/scratch_form.xhtml"">
</page>
</pages>

Related

Automatic page refresh even we navigate to another page

i have a problem in page navigating. please help me to solve out.
in one asp.net page forexample Page1.aspx i have dropdown when we select an item in dropdown that would display in a label. Then we navigate to another page from page1.aspx to page2.aspx by clicking linkbutton in page1.aspx. Again if i come to page1.aspx that previously selected value of dropdown should appear in label.
please help me.
HTTP is a stateless protocol. This means that it'll forget anything that you don't tell it to specifically ask it to.
When going back to Page1.aspx, your program has no idea what was selected before.
In terms of persisting user choices, you should look into storing them in Session ( or alternatively, cookies ) and checking for a pre-existing choice when returning to Page1.aspx.
If you have a saved value for the user at that point, you'll be able to set the correct value during the Page_Load event.
If it is like a wizard, I suggest you use a wizard control in the same page.
here is an example,
https://web.archive.org/web/20211020103244/https://www.4guysfromrolla.com/articles/061406-1.aspx

Browser back button does not move to the previous View

I am using views concept in my asp.net form control.my first view consist of a form to capture user details.when user press continue it will move to the second view.
The problem is ,When user press the back button of the browser from the second view it doesn't move the the previous view instead move to the previous page in the browser history.
I wanted to move to the first view with the existing data in the form,when user press the back button of the browser.
You should perform a full page postback I guess, so that at client end your previous view will be saved in browser's history.

Gridview still displays when navigating away then returning

I am sure this is not a unique problem, but I am drawing a blank (Monday morning) on how to fix it.
On my Nav menu, user opens a page with a DDL, selects a record from drop down which opens up a single line in a Gridview with a few fields displayed. User can click Edit and Update two fields or of course Cancel, or select another record from the drop down which displays the new record in the Gridview.
All this works fine.
Issue is when the user goes to Nav menu and goes to another page then comes back to the first page, the last record that was being viewed is still displayed in the Gridview instead of showing only the DDL and waiting for a selection. Its as if the Page Load event does not fire again (In fact it does not). I need it to fire as an initial load, in order for the 'If Not ISPostback Then' logic to properly fire.
It seems the page is cached and simply reloaded or redisplayed, is there any event that fires or is this all browser??
thanks for any ideas.
You should ensure that your pages are not being cached, both by IIS and by the end user's browser.
To ensure that the page isn't cached by IIS or the client's browser, you can add the following directive to the top of the page:
<%# OutputCache location="None" %>
You can find more information in MSDN, but this is the same as setting cacheability in the response except it is declarative, which I personally prefer.
As an alternative, if you don't want any pages cached, you can add the following section to the system.web section of web.config:
<caching>
<outputCache enableOutputCache="false" enableFragmentCache="false" omitVaryStar="true" />
</caching>
More details on this can also be found in MSDN.

post asp.net form

I have an aspx page. In tag i wrote action property to some url.
There is a submit button, when i press it the page is submitted. This is quite simple....
But what i will do when i have to submit that page to three different URLs upon pressing three different submit buttons? How would i handle the action property of tag for three different URLs. Can i submit form from server side?(I mean by changing action property of form dynamically).
I am new to asp.net please help me as soon as possible.
I will be thankful to you...
take a look at the PostBackUrl-Property as explained here:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.postbackurl.aspx

Anchoring to clicked item in asp.net page

I've a datagrid on an asp.net page "A" which shows different customer orders.
On clicking on one any row/OrderId,user is redirected to another page "B" which displays order details.
When user clicks "Back to Page A" on page B,I need to have the same order Id "anchored" on page A.
How do i achieve this functionality in asp.net?
Thanks for reading.
Joel's answer is correct, however, if you have a more complicated scenario you could do the following.
Modify the display on Page A to render an <a name="myRecord" /> for each row of the grid.
On page B, you can redirect back to page A and pass #myRecord at the end of the url, to navigate to the specific entry.
In most browsers, the back button remembers where your were in the page. So a simple javascript:history.go(-1) should do just fine, and anyone who doesn't have javascript enabled can just click the back button.

Resources