Skip to content
Loading
       
   


and in asp.cs page

you can get the value of Span using span.InnerText e.g.

lblSystem.InnerText = "Sarath";

hope it helps you
0
  • Sarath Kumar
    0
    ya..thank you so much but i want to save any value. means i.e,editable label. whatever enter the value in textbox i want to save that value.
    My code:in aspx page
     

    In .cs file

    I want to save that value to:
    Response.Cookies["Models"]["modelname"]="save here";\


    please anyone help guys..i'm struck with this from last 3days..yhanks in advance...
    0
  • Lakshmanan Sethu Sankaranarayan
    0
    Hi Sharath, Please use the following code to store your value in the cookies. HttpCookie cookie = new HttpCookie("Details"); cookie.Values.add("Value", lblSystem.InnerText); cookie.Expires = DateTime.Now.AddDays(7); HttpContext.Current.Response.AppendCookie(cookie);
    0
  • Sarath Kumar
    0
    Hi,

    I got answer.

    aspx page:


                           
                       



    in .cs page:

    Response.Cookies["Models"]["modelname"] = txt.Value;
    0
  • Jaganathan Bantheswaran
    0
    Why do you want to save id of a control? What are you trying to achieve here?

    Do you want to save id of a control or value of a control?

    If you want to access a control in Server side [.cs file], you have to use runat="server" in the control like runat="server" />

    Response.Cookies["Models"]["modelname"]= txt.InnerText;
    0
  • Sarath Kumar
    0
    here i want to save that textbox value. for that it's working
    0