My example:
I have a View
that presents a set of div tags that has content populated from the datamodel.
[Multiple of these, with different location_id, naturally]
<div>
<a name="location_id"></a>
Content
</div>
Now, I have a form [in its own view] that submits content that adds another record to the datamodel. Once the record is create and submitted, I redirect back to the Action
that returns the View
with the <div>
listing.
My challenge:
I'd like the page to focus the <div>
block that was just created. Ideally I'd like to do this without the use of javascript, - I'd like to use an #location_id ending to the URL.
Like so: http://site/Controller/Action/Id#12
(or something along those lines).
Anyone got any tips on how to go about doing this?
Edit: I cannot use the controller's Redirect
method (or anything involving a raw url. It needs to be routed either through Controller/Action
or Route
mechanisms).