473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Masked Edit Control

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.
Nov 19 '05 #1
1 5481
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/com...InputMask.aspx
http://www.eworldui.net/CustomContro...edTextBox.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"metridevkk" <me********@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.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.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: david | last post by:
Anybody could give me hint how use this control in asp.net web form. The problem is: I try to use COM component in my web form app by using MS training kit for windows form application. I would...
1
by: larry | last post by:
hi, using the masked edit control in vb.net, I have a control named mskbanknum when i set mskbanknum.text = "125" the value "125" is not displayed in the vb.net form the debugger verify's...
1
by: Kostis | last post by:
Hello there! I have created a windows application in VB.NET and I want to retrieve data from an access database. I create the OleDbConnection, an OleDbAdapter, a dataset and finally a Data Form...
3
by: Panos | last post by:
Hi all, I can't clear a Masked edit control. I use it to input dates, so I have defined the mask as "##/##/####". I use the the well known meb.mask="" meb.text="" , but nothing happens. Does...
0
by: jin | last post by:
Hi, i sa wthe textbook said, # is a digit place holder which entry required while 9 is a digit place holder which entry optional actually what is the meaning of entry optional and entry required,...
7
by: DazedAndConfused | last post by:
Curently I manualy code keypress edits. i.e. allow only 3 digits before decimal and two digits after decimal in .NET. Is there an easy solution to mask text boxes? The MSMASK32.OCX from vb6...
0
by: jean-michel bain-cornu | last post by:
Hi all, I'm trying to get the whole field selected when the caret arrives into a wx masked control. This is perfectly done with the program below. But if I comment out the line "r=...
3
by: dmbuso | last post by:
I have a money field defined in a SQL Server 05 database with a value of 49.50. Also, it displays in SQL Server as 49.5000. I have a form in VB.NET 2005 and I'm using the new MaskedTextBox control...
4
by: mwcapps | last post by:
I have unformatted text in my SQL 2005 database. I'm pulling it into a masked edit text box with a (999)999-9999 mask. Unfortunately, when I attempt to save the data back it doesn't work because I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.