|
Rank: Newbie Groups: Member
Joined: 3/16/2010 Posts: 3
|
Hello,
I have a MaskedEdit control and a button on a form. <div> <eo:MaskedEdit ID="eoPriority" runat="server" Width="20px"> <eo:MaskedEditSegment Mask="00" SegmentType="Mask" /> </eo:MaskedEdit>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /> </div>
Now when the user enters a number and clicks the button, I cannot retrieve the text the user entered in the code-behind
protected void Button1_Click(object sender, EventArgs e) { string test = eoPriority.Text; //always empty string }
I also tried to set EnableViewState="True". But that does not solve the problem.
Any ideas?
Thanks in advance,
Jan
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We tried your code and it's working fine here. Can you try it in a separate blank page?
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 3/16/2010 Posts: 3
|
The example I showed was already in a blank page. Like this:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <eo:MaskedEdit ID="eoPriority" runat="server" Width="20px" EnableViewState="true" name="bla"> <eo:MaskedEditSegment Mask="00" SegmentType="Mask" /> </eo:MaskedEdit>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
</div> </form> </body> </html>
Jan
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
How did you verify that eoPriority.Text is always empty? We tried to use a Label to display it and it is not empty.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 3/16/2010 Posts: 3
|
Ok,
Did a couple of tests.
I created a new website and used a label to display eoPriority.Text, as well as a label to display a normal textbox. The code is as follows:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <table> <tr> <td> <eo:MaskedEdit ID="eoPriority" runat="server" Width="20px" EnableViewState="true" name="bla"> <eo:MaskedEditSegment Mask="00" SegmentType="Mask" /> </eo:MaskedEdit> </td> <td> <asp:Label ID="Label1" runat="server"></asp:Label> </td> </tr> <tr> <td> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </td> <td> <asp:Label ID="Label2" runat="server"></asp:Label> </td> </tr> </table> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /> </div> </form> </body> </html>
and the codebehind:
using System;
public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //eoPriority.Text = "5"; } protected void Button1_Click(object sender, EventArgs e) { Label1.Text = eoPriority.Text; Label2.Text = TextBox1.Text; } }
The normal Textbox shows fine EO MaskedEdit not. Another thing I noticed that I cannot set eoPriority.Text! The value stays empty
Jan
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We tested the code and enter "5" or "12", both worked fine here.
I am not sure what's causing the problem for you. It could be that the control is not able to load any JavaScript it needed to run. Please verify when you put focus inside the MaskedEdit whether the whole MaskedEdit text get highlighted (blue). If it does not get highlighted, check whether you have a file eo_web.ashx on your app's root directory.
You can also try the same code inside our sample project --- just load our sample orject with Visual Studio, then create a new page and copy your code in. Run it and see what you get.
If you still have problem, we will be happy to take a look of your machine to see what we can find. We use GotoMeeting to do remote sessions. It should not be difficult for us to find out what's going on. Please let us know if you wish us to do that.
Thanks!
|
|