1

I want to display a prompt message when he is redirceted from a special page, how can accomplish this? Passing messsage as paramater is not so pretty. a used a booling paramater to determinig situation to display message.

1 Answer 1

2

Why not pass the boolean in ViewData (whether to display the message) based upon interrogating Request.ServerVariables["http_referer"] in your controller?

in controller

ViewData["DisplayMessage"] = 
    Request.ServerVariables["http_referer"] == "http://Special.com";

in view

<% if ((bool)ViewData["DisplayMessage"])){ %>
<div>YOUR MESSAGE</div>
<% } %>

Kindness,

Dan

Sign up to request clarification or add additional context in comments.

1 Comment

So i need to define so many message in detination page for each source page, and if a new page being added i should change detination page. that's not so good!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.