Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there,
I have page named GAL.aspx in that i have a dropdown box in that it have 3 departments namely Mechanical,CSE,EEE.Each dropdown will display some pictures whlie selected from the dropdown.


I have a menubar as given in the masterpage in that three submenus named CSEgal ,EEEgal , Mechanicalgal so while clicking this submenu CSEgal it should go to the GAL.aspx page and get selected the Dropdown CSE.

So please tell me how to link and code for it.
Posted

1 solution

Add Querystring for all three in menu section

For mechanical submenu "GAL.aspx?GALOption=Mechanical"
For CSE submenu "GAL.aspx?GALOption=CSE"
For EEE submenu "GAL.aspx?GALOption=EEE"

Add below code in pageload

C#
if (!IsPostBack)
        {
            if (Request.QueryString["GALOption"] != null)
            {
                if (Request.QueryString["GALOption"].ToString() != "Mechanical")
                {

                    ddlCategory.Items.FindByText("Mechanical").Selected = true;
                }
                else if (Request.QueryString["GALOption"].ToString() != "CSE")
                {
                    ddlCategory.Items.FindByText("CSE").Selected = true;
                }
                else if (Request.QueryString["GALOption"].ToString() != "EEE")
                {
                    ddlCategory.Items.FindByText("EEE").Selected = true;
                }
            }
        }
 
Share this answer
 
Comments
pradiprenushe 13-Aug-13 4:34am    
@ManojMurali Thanks for accepting answer
Joezer BH 14-Aug-13 9:17am    
5ed! ;)

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