tags:

views:

41

answers:

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  A: 

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

Daniel Elliott
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!
mehran