Click here to Skip to main content
15,903,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi how to get selected dropdown values from one page to another page?

here is some code

this code is in one page
C#
int.TryParse(cmbCompany.SelectedValue, out companyID);
      if (DateTime.TryParse(radtxtDateFrom.Text, out dtTemp))
      {
          startDate = dtTemp;
      }
      if (DateTime.TryParse(radtxtDateTo.Text, out dtTemp))
      {
          endDate = dtTemp;
      }



and this selected value i want in another page
in second page i used like this
C#
    string strCompanyID = string.Empty;
 Int32? companyID;
int Company;
if (Int32.TryParse(strCompanyID, out Company) == true)
          companyID = Company;
      else
          companyID = 0;


here am getting companyID as 0 only..can any one suggest me ??

thank you
Posted

Hi,

Your Question is looks like pass the values from one page to another page... right...?

you can do it by using QueryStrings...

for better understanding about querystrings you can check this link

Passing variables between pages using QueryString[^]

and you can check this link for transfer data from one page to another ....

Transferring page values to another page[^]
 
Share this answer
 
Comments
ythisbug 25-Jan-13 1:31am    
thank you..but in second page am not using and html code i mean textbox or dropdown list..so how can i use here/...
Check this similar QA thread,
Pass value from DropDownList to other aspx page [^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900