3

I have a general question and I have no code to show (because I wouldn't know what to try). I have tried to research this, but I guess I'm either not searching for the right keywords (or looking up the right words in my book's index), or such thing doesn't come easily.

All I want to know is if there is a way to post, using the common form method, in WebMatrix (C#) that will not change the position of the screen after post, regardless of what that position may be?

It may not exist, but it seems like it might, and I would hate to think it didn't exist, if indeed it did, just because I couldn't find any topics on it.

carlosfigueira
  • 85,035
  • 14
  • 131
  • 171
VoidKing
  • 6,282
  • 9
  • 49
  • 81
  • I think you're looking for a script that will return to the same position you were at when you submitted the form as you are able to do in VS with code behind pages. Not change the position of the form (as that would be AJAX and the form itself wouldn't change). – mawburn Oct 19 '12 at 21:36

1 Answers1

1

Usually you'd use Javascript/Ajax to submit your post asynchronously. But since you asked for the "common post method", which I assume you mean a normal button-click post event, you should check this answer:

ASP.NET MVC3 Razor - Maintain scroll position on postback

Community
  • 1
  • 1
mellodev
  • 1,597
  • 12
  • 20
  • Well, thanks for the answer, but the post you sent me to also referred to using AJAX or hidden input field. I would use hidden input field, but it gets really sloppy, and I am afraid I do not yet know AJAX. I'm actually only a few months into the server-side environment really (although I've logged many hours doing it in those months). I suppose it is time to learn yet another language :) (I don't know, is AJAX considered another language? probably...) – VoidKing Oct 19 '12 at 21:46