HI Guys,
I populate this select using C# code.
When I submit this form how do I get the selected value on the the new page?
thanks Guys
Loading
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
Amit ChoudharyRank #145 · 15.8K reputationPosted Dec 7, 2009, 8:24 PM EST
There are two ways.. either use session of send the selected value with url...
for session:
Session["selectedvalue"]=ddlgrp.SelectedValue.text;
and retrieve it as:
string value=Session["selectedvalue"].ToString();
or you can send the value in parameter as
Response.Redirect("~/Anypage.aspx?val="ddlgrp.SelectedValue.text);
if it is your answer then please mark it...
mohamad ali7 reputationPosted Dec 8, 2009, 11:47 AM EST
I thought of this
but for textboxes I did this:
Devicename = Request["txtdevicename"].ToString();
I thought maybe there is a similar way for select ??
Amit ChoudharyRank #145 · 15.8K reputationPosted Dec 8, 2009, 7:40 PM EST
If you give your select object an id:
[HTML]