Mar 22, 2012, 10:27 AM
Value && Text in SelectBox in CodeBehind
Hey.
I want to show in the selectbox "hello" but you save the identifier "1"
As I can do?
thank you very much
I want to show in the selectbox "hello" but you save the identifier "1"
As I can do?
thank you very much
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
this.xample.Value = 1;
this.xample.Text = "Hello";
}
protected void test(object sender, DirectEventArgs e)
{
//I want that is worth "1" but it "hello"
string test = e.ExtraParams["test"];
this.exit.Text = test;
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Ext.Net Example</title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button runat="server" Text="Cambiar" Icon="Accept" >
<DirectEvents>
<Click OnEvent="test" >
<ExtraParams>
<ext:Parameter Name="test" Value="xample.getValue()" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
<ext:SelectBox ID="xample" runat="server" />
<ext:TextField ID="exit" runat="server" HideLabel="true" />
</body>
</html>