I need to use a Masked Edit Control in my ASPX page. In VS.Net, I added the
reference to MSMask.dll for my application & also added the MaskEdBox to the
Toolbox.
After adding the control to the web form, when I select the control & see
its properties, I do not see the "Text" property. I also try to set the
"Text" property in a javascript function, but cannot access it.
Here is the code:
=================================================
<HTML>
<HEAD>
<title>WebForm1</title>
<script language="JavaScript">
function LoadControls()
{
alert(document.forms[0].mskOffice);
document.forms[0].mskOffice.Text = "510-739-1499";
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout" onLoad="LoadControls();">
<form NAME="form1" id="Form1" method="post" runat="server">
<asp:label id="Label1" style="Z-INDEX: 101; LEFT: 252px; POSITION:
absolute; TOP: 83px" runat="server" Width="83px">Enter Phone:</asp:label>
<OBJECT id="mskOffice" style="Z-INDEX: 104; LEFT: 340px; WIDTH: 153px;
POSITION: absolute; TOP: 82px; HEIGHT: 26px" codeBase="msmask32.ocx"
classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC" name="mskOffice"
VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="4048">
<PARAM NAME="_ExtentY" VALUE="688">
<PARAM NAME="_Version" VALUE="393216">
<PARAM NAME="BorderStyle" VALUE="1">
<PARAM NAME="ClipMode" VALUE="0">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="Appearance" VALUE="1">
<PARAM NAME="BackColor" VALUE="-2147483643">
<PARAM NAME="ForeColor" VALUE="-2147483640">
<PARAM NAME="PromptInclude" VALUE="-1">
<PARAM NAME="AllowPrompt" VALUE="0">
<PARAM NAME="AutoTab" VALUE="0">
<PARAM NAME="HideSelection" VALUE="-1">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="MaxLength" VALUE="64">
<PARAM NAME="OLEDragMode" VALUE="0">
<PARAM NAME="OLEDropMode" VALUE="0">
<PARAM NAME="PromptChar" VALUE="_">
<PARAM NAME="Mask" VALUE="###-###-####">
</OBJECT>
</form>
</body>
</HTML
=========================================
alerting "document.forms[0].mskOffice" returns [Object], however the Text
property is not set.
I am a newbie in ASP.NET and ActiveX Controls, so any help will be greatly
appreciated!!!!
Thanks.That's not a web control, therefore it's not very suitable for use on a web
page.
That's meant more for a windows forms application.
Here are some free masked edit web controls that will probably work out
better for you:
http://www.assistedsolutions.com/co.../InputMask.aspx
http://www.eworldui.net/CustomContr...kedTextBox.aspx
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"metridevkk" <metridevkk@.discussions.microsoft.com> wrote in message
news:1A9F2538-CBBC-462D-8CCB-8337AF09EB42@.microsoft.com...
> Hi,
> I need to use a Masked Edit Control in my ASPX page. In VS.Net, I added
> the
> reference to MSMask.dll for my application & also added the MaskEdBox to
> the
> Toolbox.
> After adding the control to the web form, when I select the control & see
> its properties, I do not see the "Text" property. I also try to set the
> "Text" property in a javascript function, but cannot access it.
> Here is the code:
> =================================================
> <HTML>
> <HEAD>
> <title>WebForm1</title>
> <script language="JavaScript">
> function LoadControls()
> {
> alert(document.forms[0].mskOffice);
> document.forms[0].mskOffice.Text = "510-739-1499";
> }
> </script>
> </HEAD>
> <body MS_POSITIONING="GridLayout" onLoad="LoadControls();">
> <form NAME="form1" id="Form1" method="post" runat="server">
> <asp:label id="Label1" style="Z-INDEX: 101; LEFT: 252px; POSITION:
> absolute; TOP: 83px" runat="server" Width="83px">Enter Phone:</asp:label>
> <OBJECT id="mskOffice" style="Z-INDEX: 104; LEFT: 340px; WIDTH: 153px;
> POSITION: absolute; TOP: 82px; HEIGHT: 26px" codeBase="msmask32.ocx"
> classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC" name="mskOffice"
> VIEWASTEXT>
> <PARAM NAME="_ExtentX" VALUE="4048">
> <PARAM NAME="_ExtentY" VALUE="688">
> <PARAM NAME="_Version" VALUE="393216">
> <PARAM NAME="BorderStyle" VALUE="1">
> <PARAM NAME="ClipMode" VALUE="0">
> <PARAM NAME="MousePointer" VALUE="0">
> <PARAM NAME="Appearance" VALUE="1">
> <PARAM NAME="BackColor" VALUE="-2147483643">
> <PARAM NAME="ForeColor" VALUE="-2147483640">
> <PARAM NAME="PromptInclude" VALUE="-1">
> <PARAM NAME="AllowPrompt" VALUE="0">
> <PARAM NAME="AutoTab" VALUE="0">
> <PARAM NAME="HideSelection" VALUE="-1">
> <PARAM NAME="Enabled" VALUE="-1">
> <PARAM NAME="MaxLength" VALUE="64">
> <PARAM NAME="OLEDragMode" VALUE="0">
> <PARAM NAME="OLEDropMode" VALUE="0">
> <PARAM NAME="PromptChar" VALUE="_">
> <PARAM NAME="Mask" VALUE="###-###-####">
> </OBJECT>
> </form>
> </body>
> </HTML>
> =========================================
> alerting "document.forms[0].mskOffice" returns [Object], however the Text
> property is not set.
> I am a newbie in ASP.NET and ActiveX Controls, so any help will be greatly
> appreciated!!!!
> Thanks.
0 comments:
Post a Comment