如何在asp.net中为CreateUserWizard添加附加控件 [英] How to add addtional control to CreateUserWizard in asp.net
本文介绍了如何在asp.net中为CreateUserWizard添加附加控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我添加了一个下拉列表来创建用户向导。
在源代码中我添加了以下代码
Hi
I added a dropdown list to createuserwizard.
in the source i added following code
<tr>
<td align="right">
<asp:Label ID="Application" runat="server" AssociatedControlID="Application">Application:</asp:Label>
</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" BackColor="#9999FF" Font-Bold="False" Font-Italic="True" Font-Names="Tahoma" Font-Size="Larger" ForeColor="White">
<asp:ListItem>----SELECT VALUE----</asp:ListItem>
<asp:ListItem>CRX</asp:ListItem>
<asp:ListItem>QA</asp:ListItem>
<asp:ListItem>MFDL</asp:ListItem>
<asp:ListItem>DMS</asp:ListItem>
<asp:ListItem>CPGN</asp:ListItem>
<asp:ListItem>INFOVIEW</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="DropDownList1"
ErrorMessage="Application should be selected." Font-Size="Larger"
ToolTip="Application should be selected." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
</td>
</tr>
现在的问题是如何在下拉列表中检索所选的值
我试图将该值发送到字符串,如下所示
string abc = CreateUserWizard1.Dropdownlist1;(我没有从列表中获取下拉列表CreateUserWizard1 .----
Now the problem is how to retrive the selected valu in dropdownlist
I was trying to send that value to a string as below
string abc = CreateUserWizard1.Dropdownlist1;(I am not getting dropdownlist from the list CreateUserWizard1.----
推荐答案
this is the syntax to retrive the selected value in dropdown list that was added.
string sel = ((DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("DropDownList1")).SelectedItem.Text.Trim();
这篇关于如何在asp.net中为CreateUserWizard添加附加控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文