|
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...
|
|
|
|
|
Hi all ,
I am new to web development , How many concurrent threads can execute by the webserver, And what is the difference between webserver and application server.
Thanks & Regards
Srinivasa Rao S
|
|
|
|
|
Hi ,
I am new to web devlopment , i am hearing about webservices , but i dont what is exactly webservice , and wht for we are developing the webservices. Can any help me out.
Thanks & Regards
Srinivasa Rao. S
|
|
|
|
|
Hi i am developing project on serach engine in local area network. What is the best search criteria i can apply.
How i can prooceed in programming and what algorithms to use
patt
|
|
|
|
|
Hi all ,
My name is srinivas, i am perl developer, i am beginner to the perl and web development. I dont know how to display the html page in different languages.Can any one help me out.I am thankful to that person
Regards
Srinivasa Rao S
Mphasis Technologies,
Bangalore
India
-- modified at 7:55 Monday 29th May, 2006
|
|
|
|
|
I am a .net developer.I dont know how to embedd asp and applets.Plz let me know abt it...
Thanks in advance
-- modified at 8:01 Monday 29th May, 2006
|
|
|
|
|
In ie the page onload event is fired before the page actually show up with all its images and data.So on onload event i had taken some xml file data which i had displayed in html and it is ok.
BUT in firefox the page is shown up first and then the page onload event is fired so the html does not get the xml values and show as undefined. Although it gets xml values but after the page shows up.
how can this be avoided .
A help will be appreciated deeply. Thanks in advance .
|
|
|
|
|
Plz let me know how to integrate applets with asp.net
thanks in advance
nag.
|
|
|
|
|
Can someone please advice me on how I can make a forum on my web page!!!
You are what you do when you think nobodys looking
|
|
|
|
|
|
An application(asp.net(.net2)) generating reports using
crystal report is published and accessed over a link.After using
the link and generating reports for a while,reports are not not generated further.
Is this having anything to do with crystal report registration,memory problems(dataset is used) or something else???
|
|
|
|
|
Hi guys,
Having always been in the fortunate position to work in a team where we've had a designer I've never paid too much attention to designing stylesheets, etc (yep, I am gaining a newfound respect for designers )
Anyway, I've started out with a stylesheet and a single default.aspx page, and some elements on my default page work great, others don't:
body <br />
{<br />
background-repeat: repeat-x;<br />
margin: 1;<br />
padding: 0;<br />
text-align: center;<br />
font-family: verdana, arial, helvetica, sans-serif;<br />
font-size: 0.9em;<br />
color: #575757;<br />
width: 800px;<br />
border: double: 3px 3px 3px 3px: #5f5bb2;<br />
}
The margin is great, the text aligns in the center, the font displays nicely as verdana, the font color and size are great. However, the border doesn't display and although text on my page is centered, images aren't. Am I incorrect in thinking that text-align: center; should align everything on the page in the center?
What I'm actually hoping to do is have an 800px centered body, and that containing a div with text aligned to the left so that there's always equal space on either side of the main body, regardless of monitor size, but the text is left aligned.
I really should have taken more notice of what the design team were up to. Thanks for any help
A mum and loving it!
-- modified at 0:06 Monday 29th May, 2006
I forgot to say - the images I'm hoping to center this way atm are my banner and links images, so they're 800px wide. Thanks!
|
|
|
|
|
Corrections:
margin: 1px;<br />
<br />
border: double 3px #5f5bb2;
The text-align property only affects text, not block elements.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks Guffa, I must be working out of an old book (that's what comes of using books from the local library I guess).
Guffa wrote: The text-align property only affects text, not block elements.
Can you tell me what property I should use for this then? Thanks
A mum and loving it!
|
|
|
|
|
Block elements are aligned by setting style on the element itself, not on the parent element. Example:
<div class="parent"></div class="child"></div></div><br />
<br />
.parent { width: 500px; }<br />
.child { width: 200px; margin: 0 auto; }
---
b { font-weight: normal; }
|
|
|
|
|
Thanks Guffa
A mum and loving it!
|
|
|
|