Hi Rick, There are several submit on my side. Each submit stores data and then builds up the same page. I am looking for a way in web-connection to set an #anchor behind the querystring so that after saving datas should be returned to the place of the submit. Is there any way? Thanks, Joachim Kumpa

Sure - it's just a URL add the #anchor
at the very end after the query string. That should work to navigate the page when it returns assuming the content is server rendered and available and the anchor Id or Name is in the content immediately after load.
+++ Rick ---
Yes .. I know that I have to put an anchor at the end of the query. I do this when I put the query string for the next page to be called, befor Response.ExpandTemplate() is called:
Yes .. I know that I have to put an anchor at the end of the query. I do this when I put the query string for the next page to be called, befor Response.ExpandTemplate() is called.
The server/browser does not seem to be recognized. On the other hand, i can see the #Anchor is in the URL of the new page. Even if I check WebConnection-Status under "Display Request", I don't see that the #anchor behind the querystring is set ( in the wwrequestlog the same ). Therefore i think i put the #anchor in the wrong place in the program process. I hope I've explained my problem better now.

The server/browser does not seem to be recognized.
I'm not sure what that means in this context. You mean the URL does not want to navigate in the browser when the anchor follows a querystring?
Html Anchors are not part of the querystring so they aren't returned as part of that. The only way you'll see it is in the full Url, but there are no server APIs that pull out an anchor AFAIK - you'll have to parse the full Url.
+++ Rick ---
Yes, i mean the URL does not want to navigate in the browser when the anchor follows a querystring. I create the full URL with the anchor as querystring and put it as form action-attribute through methode Response.ExpandTemplate. If the page is then displayed for the first time, the anchor don't work, the page is displayed at the beginning. When i Submit now the page again the querystring in the form action-attribute is read and it works. I need a way to create a querystring ( for the first-time-display) that the URL navigate in the browser.
That's an issue with the browser doing something weird - it has nothing to do with what happens on the server. Assuming the Anchor is on the response url that should work. If it doesn't it's either because the content you're navigating to hasn't been rendered yet (and yes that's quite possible) or because the anchor is invalid or not in the document.
In my experience anchor navigation in browsers is not super reliable - there are lots of scenarios where it doesn't work or works inconsistently. Some of this is due to modern browser rendering optimizations that make the DOM available before the document has completely rendered in the browser.
If you want to be sure the page navigates internally add some JavaScript that waits for the page to load then manually focus that location in the page.
Something like this (off the top of my head):
<script>
// at bottom before </body>
document.addEventListener("load", ()=> {
const anchor = window.location.hash;
document.getElementById(anchor.substr(1)).scrollIntoView();
});
</script>
You might even want to add a little delay with setTimeout()
to that just to make sure the element is there and in the right position.
+++ Rick ---
Thanks for your considerations. I tried them but without success. I myself have no idea to solve the problem.
But thanks for you, Joachim
You can't set an anchor on the server - it has to be done via the submission URL that is clicked or on executed via submit of a form. Once the request goes to off the URL can't be changed so you can't add anything to that Url after the fact based on what you do on the server. You can do that before you submit (onsubmit handler in JS) but not after.
You can change the behavior dynamically by way of injecting JavaScript code on document load like I showed in the last reply.
+++ Rick ---