|
|
Hello all!
I'm wondering, can I use a MaskedTextBox in my ASP.NET 2.0 web form? I see it in my VS2005 toolbox when creating windows applications, but it isn't in my toolbox when creating a web form. How can I implement a MaskedTextBox in an ASP.NET 2.0 web app? for example, a phone number input textbox would already show the ( ) - in the textbox. Has anyone done this?
Thank you!
"Half this game is ninety percent mental."
- Yogi Berra
If you can read thank a teacher, if you can read in English, thank a Marine.
|
|
|
|
|
Hi there,
AFAIK, there's no built-in masked TextBox control in the ASP.NET 2.0, you check out the ASP.NET Custom Control Gallery[^], we used the telerik's one and happy with it.
|
|
|
|
|
|
Just use <asp:textbox textmode="password" ....="">
Mihai Voicu Drebot
|
|
|
|
|
|
seccond time today this happens to me
<asp:textbox textmode="Password" ....="">
this actualy adds some more functionality, like disabling copy/paste, etc
Hope i understood correctly what you need
|
|
|
|
|
|
it just doesn't like what i put there
use the asp:TextBox, with attribute TextMode="Password"
|
|
|
|
|
|
Hello I want to create a tab control just as given in
http://www.indianindustry.com/
-- modified at 7:35 Wednesday 31st May, 2006
|
|
|
|
|
search the articles, a couple of people here have posted tab controls.
|
|
|
|
|
Hi,
I am developing a project, that feeds new record into a db, all is well so far, however i am having a problem sorting out one the errors, if a duplicate key is being input, the system error displays, i would like to know how ta catch the expeption where a duplicate key is beeing input?
Cheers
Crazzy SH!T
|
|
|
|
|
A better way would be to ensure that is is not possible to try and enter a duplicate key at all, as exceptions are quite processor heavy, but:
try
{
}
catch (SqlException sqlEx)
{
}
finally
{
}
|
|
|
|
|
Hey all,
When I bind my datagrid with a dataset that contains a date column.
<asp:BoundColumn DATAFIELD="paydate" HEADERTEXT="Pay Date">
</asp:BoundColumn>
The datagrid display the date as my currentculture by default, I was pretty excited about that. but when I change my regional setting to UK or US or whatever, Datagrid still displayed fr-CA regional settings. I've to force the culture throught the web.config to see the change.
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-GB"/>
Why when I load the web application with no settings in the web.config it still displayed fr-ca settings instead of those i set in regional settings. ?
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
I look at the machine.config, there is nothing set too.
Anyone have idea ?
Regards.
_______________
Hugues Gauthier
|
|
|
|
|
Hi there,
Basically, when the ASP.NET is running, the default culture of the application is set based on the ASPNET process identity's locale, it means that it is set based on the ASPNET(or NETWORK SERVICE) account, and not the current log-on account. And as you may already know that you can overwrite this default value by setting the culture info in the web.config file or in the Page directive (for a specific web page), or in code.
|
|
|
|
|
Hey,
Thanks
This is redirected me to another solution so here it is.
I used the languages of the browser. So a user can specify any language that he wants.
To set the languages of the browser, go in the menu Tools-Internet Options and look for Languages(button), I use IE7 beta2
You have to put this in the global.asax
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
If Not Request.UserLanguages Is Nothing Then
Dim cultureInfo As Globalization.CultureInfo = Nothing
Dim index As Integer = 0
While cultureInfo Is Nothing AndAlso index < Request.UserLanguages.Length
Dim language As String = Request.UserLanguages(index)
If RegularExpressions.Regex.IsMatch(language, ".{2}-.{2}") Then
language = RegularExpressions.Regex.Match(language, ".{2}-.{2}").Value
Try
cultureInfo = New Globalization.CultureInfo(language, False)
Catch ex As NotSupportedException
'Invalid culture specified
End Try
Else
Try
' Try to create a specific culture with the neutral culture specified
cultureInfo = Globalization.CultureInfo.CreateSpecificCulture(language)
Catch ex As ArgumentException
' No default specific culture available for the neutral provided.
End Try
End If
index += 1
End While
If cultureInfo Is Nothing Then
cultureInfo = New Globalization.CultureInfo(DEFAULT_CULTURE, False)
End If
Threading.Thread.CurrentThread.CurrentCulture = cultureInfo
Threading.Thread.CurrentThread.CurrentUICulture = cultureInfo
End If
End Sub
I Love Code Project
_______________
Hugues Gauthier
|
|
|
|
|
Hi
I wanna clarify something !
why even I set currentUIculture and currentculture in the global.asax, sql server fill my dataset as en-US culture ?
I used Enterprise Library with StoredProcedured to get the data. when my dataset is filled and I look at the result of a date column, here is the result
#5/31/2006 10:46:23 AM#
and with the currentUIculture was preset as "fr-CA" it must be
#2006-05-31 10:46:23#
why my preset culture is bypass ?
Anyone have Idea ?
thanks
_______________
Hugues Gauthier
|
|
|
|
|
+ Are you sure the current culture of the thread is "fr-CA"? You might want to double check this value at runtime.
+ Can you simply try to write out the DateTime.Now to the Response object and see if the datetime value is in the expected format?
|
|
|
|
|
Hello everyone,
I have a table set up to look like a box with 4 tabs. There are two classes of tabs, tabactive and tabinactive. tabactive has a white background, black border on the top, left, and right, and a white border on the bottom. tabinactive has a gray background, and a black border on all sides. The problem I'm having is that in Firefox when I click the link that activates the javascript function to change the class of the table cell/tab, the background color changes correctly but the bottom border change doesn't always stick. I'll get tabactive tabs with black bottom borders, and tabinactive cells with white bottom borders - everything else works fine. Oddly enough, this only seems to happen for the last 2 cells/tabs (see HTML below).
Here's my CSS:
.tabactive
{
border: solid 1px black;
border-bottom: solid 1px white;
background-color: #FFFFFF;
text-align: center;
padding: 0px;
margin: 0px;
}
.tabinactive
{
border: solid 1px black;
border-bottom: solid 1px black;
background-color: #CCCCCC;
text-align: center;
padding: 0px;
margin: 0px;
}</pre>
Here's my javascript:
/* set visibility of divs and change bg color of tabs */
function TabClick(LinkName)
{
for (var x = 1; x < 5; x++) //only allows for 4 tabs right now
{
TabID = "Tab" + x //assign names w/ increment that match elements
DivID = "Div" + x //i.e. Tab1, Div2, etc
Tab = document.getElementById(TabID) //grab elements
Div = document.getElementById(DivID)
if (TabID != LinkName) //set style and vis of unselected tabs + divs
{
Tab.className = "tabinactive"
Div.style.visibility = "collapse"
Div.style.display = "none"
}
else //set style and vis of selected tabs + divs
{
Tab.className = "tabactive"
Div.style.visibility = "visible"
Div.style.display = ''
}//end else
}//end for
}//end function
Here's my HTML (note that this happens almost exclusively on Tab3 and Tab4):
<table>
<tr>
<td class="tabactive" id="Tab1"><a href="#" onclick="TabClick('Tab1')">Tab1</a></td>
<td class="tabinactive" id="Tab2"><a href="#" onclick="TabClick('Tab2')">Tab2</a></td>
<td class="tabinactive" id="Tab3"><a href="#" onclick="TabClick('Tab3')">Tab3</a></td>
<td class="tabinactive" id="Tab4"><a href="#" onclick="TabClick('Tab4')">Tab4</a></td>
</tr>
<tr>
<td colspan="4">
<DIV ID="Div1" style="visibility: visible;">This is Div1.</div>
<DIV ID="Div2" style="visibility: hidden;">This is Div2.</div>
<DIV ID="Div3" style="visibility: hidden;">This is Div3.</div>
<DIV ID="Div4" style="visibility: hidden;">This is Div4.</div>
</td>
</tr>
</table>
Any ideas? It's a pretty minor problem so it's no big deal. But the minor problems are the ones that drive me nuts. Thanks in advance for any help!
-------------------
abort, retry, fail?
|
|
|
|
|
How do I allow a PAC file on a gateway to block access to certain sites for all PCs in a LAN? Please Help....
Marvin
|
|
|
|
|
Hi All,
Can any body give me good sites related MSCMS 2002. currently i am doing R&D on the same and i know nothing about MSCMS. Awaiting eagely
Ramesh.Kanjinghat
|
|
|
|
|
|
ThanX my friend.
Ramesh.Kanjinghat
|
|
|
|
|
You can calculate different color for each of grid item. But it will not gradient but stairs'ent. Also you can generate dynamically background image for each item, that will one pixel width. But it's a head pain think twise before you are doing that, time aspect, performance and so on...
|
|
|
|