Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3443964
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:51:23+00:00 2026-05-18T08:51:23+00:00

I searched the web but haven’t found a real good answer for this question..

  • 0

I searched the web but haven’t found a real good answer for this question..

Let’s say I have a form, on AddToList.aspx, and i want that after you hit send, it will direct you back to List.aspx, with a message “The Item was added to list” in a message box div.

do i need to send List.aspx?msg=my message, or is there another good way of doing it?

EDIT:

so i made this helper class:

   public class MessageHelper : System.Web.UI.MasterPage
    {
        public void SetMessage(String message)
        {
            Session["Message"] = message;
        }

        public string GetMessage()
        {
            if (String.IsNullOrEmpty(Session["Message"]))
            {
                String temp = Session["Message"];
                Session["Message"] = "";
                return temp;
            }
            else
            {
                return "";
            }
        }
    }

and got this error:

Error   32  The best overloaded method match for 'string.IsNullOrEmpty(string)' has some invalid arguments
Error   33  Argument '1': cannot convert from 'object' to 'string'
Error   34  Cannot implicitly convert type 'object' to 'string'. An explicit conversion exists (are you missing a cast?)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:51:23+00:00Added an answer on May 18, 2026 at 8:51 am

    You could certainly use the query string to pass data to your List.aspx page, but be careful passing text that you’re planning on writing out in the HTML – you’ll need to protect against XSS attacks.

    There are several other ways to do this. Chances are, you’re going to have several places in your application where you want to redirect the user to another page, but also display a message that has something to do with what they did on the previous page (saved an item, deleted an item, etc.). It would be better to come up with more of a global scheme for this rather than a one-off just for this particular instance.

    One idea is to use the Session for storing a message, then do your redirect.

    Session("Message") = "Item was added to list."
    Response.Redirect("List.aspx")
    

    Then, on your pages (or a Master Page, perhaps), you check Session("Message") and if it’s got something, you show that message to the user, then clear that variable.

    If Session("Message") IsNot Nothing Then
      Response.Write(CType(Session("Message"), String)) 'or set a label text, or show a pop up div, or whatever'
      Session("Message") = Nothing
    End If
    

    If you use this approach, I recommend you write a helper class, and just use that to manage your messaging:

    MessageHelper.SetMessage("Item added to list.")
    

    and

    MessageHelper.GetMessage()
    

    would be the methods you would need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I searched and found this question but did not like the answer. Is there
I've searched the entire web for a clear answer but haven't found one yet.
I've searched a lot for an answer for this question in the web: they
I searched for this and found Maudite's question about text editors but they were
I searched google but couldn't find an answer to this rather simple question. I
I searched for a similar question, but haven't seen anyone ask this before. I've
I have searched the web for resolution of this error, but everything I have
I have few very simple question. I searched a web for them, but I
I've searched the web a bit, but all I found were abandoned projects and
I searched all over this site and the web for a good and simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.