本文介绍了基于多个下拉列表控件重定向到网页。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友,



我有医院1(H1),住院2(H2),医院3(H3)在ddl1和急诊(E),帐户(A) ,一般(G)在ddl2



我想去所有组合H1E,H1A,H1G,H2E,H2A,H2G,H3E,H3A,H3G每个项目是一个

的网页,选择下拉控件。



我该怎么做?



plz帮帮我。





谢谢,

Kranthi

Hi Friends,

I have hospital1(H1), hospital2(H2) , hospital3(H3) in ddl1 and emergency(E),accounts (A),general (G) in ddl2

I want to go for all combinations H1E,H1A,H1G,H2E,H2A,H2G, H3E,H3A,H3G each item is a
webpage by selecting dropdown controls.

How do i do that?

plz help me.


Thanks,
Kranthi

推荐答案

string hospital = ddl1.SelectedItem.Value;   // e.g. "H1"
string type = ddl2.SelectedItem.Value;        // e.g. "E"
string para = "http://sitename/" + hospital + type;   // e.g. "H1E"
Response.Redirect(para);



参考: []


protected void Button Click(object sender, EventArgs e)
{
    RedirectToAPageRelatedToDropDownSelectedValues(ddl1.SelectedValue, dd2.SelectedValue);
    // I assume the DropDown values are same as texts.
}

private void RedirectToAPageRelatedToDropDownSelectedValues(DropDown1SelectedValue, DropDown2SelectedValue)
{
    if(DropDown1SelectedValue.Equals("H1") && DropDown2SelectedValue.Equals("E"))
    {
        // Do whatever you want.
    }
    else if(DropDown1SelectedValue.Equals("H1") && DropDown2SelectedValue.Equals("E"))
    {
        // Do whatever you want.
    }
    // Write for all the combinations.
}


这篇关于基于多个下拉列表控件重定向到网页。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 21:05