How can i save the span id value in .cs file?
My code:
i want to save "lblSystem" value.any ine help me.......
Thanks in advance.....
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
KalaiRank #8,005 · 230 reputationPosted Feb 24, 2014, 3:23 AM EST
KalaiRank #8,005 · 230 reputationPosted Feb 24, 2014, 3:50 AM EST
test.aspx
Sarath
test.aspx.cs
string lblName = lblSystem.InnerText.ToString();
Sarath KumarRank #3,637 · 402 reputationPosted Feb 24, 2014, 4:07 AM EST
Vithal WadjeRank #19 · 47.2K reputationPosted Feb 24, 2014, 7:56 AM EST
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Feb 24, 2014, 5:36 PM EST
Biswa Pujarini MohapatraRank #465 · 5.4K reputationPosted Feb 24, 2014, 7:08 PM EST
and in asp.cs page
you can get the value of Span using span.InnerText e.g.
lblSystem.InnerText = "Sarath";
hope it helps you
Sarath KumarRank #3,637 · 402 reputationPosted Feb 24, 2014, 10:46 PM EST
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...
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Feb 24, 2014, 11:45 PM EST
Sarath KumarRank #3,637 · 402 reputationPosted Feb 25, 2014, 1:01 AM EST
I got answer.
aspx page:
<%--
in .cs page:
Response.Cookies["Models"]["modelname"] = txt.Value;
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Feb 25, 2014, 1:10 AM EST
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;
Sarath KumarRank #3,637 · 402 reputationPosted Feb 25, 2014, 1:21 AM EST