linkbutton And session

Rate It (1)

Last post 05-03-2007 10:26 PM by Jessica Cao - MSFT. 3 replies.

Sort Posts:

  • linkbutton And session

    05-02-2007, 10:17 AM
    • Member
      66 point Member
    • royroy7
    • Member since 04-10-2007, 1:35 PM
    • Posts 178
    I want to put value for session inside linkbutton
     which preferable property to use ?
    for now its on my onclick...
     
    Sincerely,
    roy
    Filed under: ,
  • Re: linkbutton And session

    05-02-2007, 11:06 AM
    • Member
      207 point Member
    • roy_huntley
    • Member since 02-02-2007, 8:31 AM
    • Posts 49

    Please explain your problem in more detail...

    Please remember...if the answer provided helped to solve the problem, mark it as 'answer' !
  • Re: linkbutton And session

    05-02-2007, 11:31 AM
    • Member
      66 point Member
    • royroy7
    • Member since 04-10-2007, 1:35 PM
    • Posts 178
     my asp code:
    <asp:LinkButton runat="server" Text="Edit" ID="lnk1" PostBackUrl="../Editor/Editor.aspx" OnClick="lnk1_Click"></asp:LinkButton>
     
    my cs code:
     
     
    public string Link
        {
            set
            {
                
                lnk1.PostBackUrl += "?ArticalID=" + value;
                lnk1.AccessKey = value;
            }
        }
     
     
     protected void
    lnk1_Click(object sender, EventArgs e) { updateArtSession up = new updateArtSession(); up.ArtCode = Convert.ToInt32(lnk1.AccessKey); }
     

    is there better way to put the value for this session?

     

     

    Sincerely,
    roy
  • Re: linkbutton And session

    05-03-2007, 10:26 PM
    Answer

    Hello,

    I am afraind that when you set the PostBackUrl for a LinkButton, the code in the lnk1_Click will never execute, and the value never be stored in the session.

    Jessica

    Jessica Cao
    Sincerely,
    Microsoft Online Community Support


    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
Page 1 of 1 (4 items)