Results 1 to 5 of 5

Thread: Unable to display value in asp.net form

  1. #1
    Join Date
    Nov 2009
    Posts
    67

    Unable to display value in asp.net form

    Hello to all,
    I am new to this forum. I am working on live project where I am using Asp.net as front end. In that program I used one session to store values before entering that value in to previous page. When I used page load it shows null value. Whenever I pass the value to button click it also shows null value. I don't know why Unable to display value in asp.net form.
    Please help me.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Unable to display value in asp.net form

    It seems that you are using some different value to store and retrieve the values and that's why you are getting null value. In this case you have to use same variable to store and retrieve the values to fix this problem. If you are able to stored the value into session on the previous page then you will be able to access the value in the second page if it is opened in the same window.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Unable to display value in asp.net form

    I think there is some problem in your code and that's why you are getting such type of problem. You may be using some wrong value in session and that's why you get null value. Just try following value in your code to get rid out of this problem.

    Code:
    session["abc"]=k;
     int k=convert.toint32(session["abc"].tostring());
    After this you will not get any problem.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Unable to display value in asp.net form

    You are providing little information and that's why it is very difficult to say right solution. If you paste code for both pages then it will be nice for me to say right answer. I think you there is any mismatch in session and that's why you are getting null value. You have to use only one value in both pages to fix this problem. Use one value in next page and previous page.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Unable to display value in asp.net form

    Hey you have to use following code in your project to fix this problem. In following code I save one value in one text file and then I use this value in both pages to display value. I stored null value in "name" session. Just try to understand following program.

    Code:
    if(!ispostback)
    {
    somefile.Text = Convert.ToString(Session["name"]);
    Session["name"] = null;
    }
    
    // For button click you have to write this 
    Session["name"] = txtFirstname.Text.Trim();
    Responses.Redirect(Requests.RawUrl,false);
    Responses.Redirects("Qualiftifuicaton.aspx");

Similar Threads

  1. Replies: 5
    Last Post: 25-05-2011, 10:21 PM
  2. Replies: 2
    Last Post: 02-05-2011, 07:06 AM
  3. Display form in VB based on user's choice
    By ASHER in forum Software Development
    Replies: 4
    Last Post: 12-12-2009, 05:15 PM
  4. Thunderbird : display of attachments in list form
    By Beter 2 Burn Out in forum Technology & Internet
    Replies: 4
    Last Post: 30-03-2009, 03:40 PM
  5. Problem reloading MDI child form in main form.
    By AFFAN in forum Software Development
    Replies: 3
    Last Post: 30-01-2009, 09:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,765,895.25289 seconds with 16 queries