Latest developer linksBookmark and Share
 
HomeThis WeekTop MonthTop AlltimeSearchRegisterFAQ
  
 
Submit Your Link
Please login to submit your Link
 

How to change the language based on log in user programmatically in SharePoint

Posted: Dec/14/2010   By: nikhil   Points:15   Category: .NET  - ASP.Net    Views:104   Vote Up (0)   Vote Down (0)    

Hi,

I created SharePoint site using MOSS 2007.I need to support Spanish(Spain) language in my site. To achieve this I have installed Spanish service pack.Now I can create site in Spanish.

I am aware that the Site Language is stored in ”Webs” table of “Content” database and the language changes from English to Spanish, If I change the language from 1033 to 3082.

What I would want to know is, how do I change the language based on log in  user(user has locale ID),  programmatically?

Please assist me, how do I change language dynamically?

Regards,

Vidya Jeerahalli

View Complete Post


Comments:
Be the first to comment this post.
 
Post Comment
Please login to post your comment
More Related Resources

Loading User Controls Dynamically

  
User Controls are great in ASP.NET. They let us divide the page into small sections. You can easily use User Controls on a ASP.NET page by simply dragging and dropping the control from the solution explorer. Sometimes we need to load the User Control dynamically. In this small article we will learn how to load the User Control dynamically.

Dynamic Binding in a Static Language, Part 1

  
This article is taken from the book C# in Depth, Second Edition. This segment looks at what it means for code to be dynamic, and the syntax involved in using dynamic typing in C# 4

php user migrating to asp.net

  

Hi, I have a website that I need to add some dynamic data from asp.net, I'm completely new to .net and am having some problems (usually a php user).

K so, I have
a simple html tag
<a href="" title = "" >my link</a>

Now all I want to do is to insert some data in to the href and title parameters. in php I would just use <a href="<?php echo myHrefvar?>" title = "<?php echo myTitlevar?>" >my link</a>

I've tried doing
<a href="<% = myHrefvar%>" title = "<% = myTitlevar%>" >my link</a>

and in my default.aspx.cs I have the variables being set
string myHrefvar = "my href";
string myTitlevar = "my title";

but it always gives the message that they're not linked.

Have also tried
<a href="" title = "" ID=Req1>my link</a>

and in the apsx.cs file
Req1.HRef = "sdsdsd";
Req1.Title = "sdsdsd";

but again I get an error saying Req1 doesn't exist in the current context.

So help, I'm missing something rather fundamental here, any help would be much appreciated.

James


send alert message to user if close internet browser before save web form data

  

 Hi, I have window form to let user fill data, I want to alert user if close web browser before saved web form data, could anyone provide any clue?

 

Thanks,

Martin


How get clientID of a control in a ModalPopup of a User Control??

  

Hi,

I have a user control which has a modal popup. This modal popup has a grid and few controls like textboxes and comboboxes. I am trying to clear out all the controls when the close button is clicked. I am using javascript to close the modalpopup. but to clear the controls, $get('<%=txtbox1.clientID%>') method is returning null. can someone please help me?


Here is my code snippet.

function close_Click() {
    var mdlPopup1;
    mdlPopup1 = $find('modalPopup');
    mdlPopup1.add_hidden(clearInputFields);
    mdlPopup1.hide();
    
}

    function clearInputFields() {
        var name = $get('<%=txtName.clientID%>');

        name.value="";
       }


User control does not let me assign values into Text boxes

  

Hello,

Got a problem that I do not know what is going on (using c# and .NET 2008):

I have a main web page and added a user control inside it. The user control has some textboxes. The problem I have is when I populate the textboxes with the data that is in the DB, they do not show the values. The strange thing is If I change the property of textboxes ReadOnly to TRUE, they show the values. The problem is that I need them to be ReadOnly=FALSE.

Could anyone do help me please?

Thanks,

Marco


Change the values displayed in my gridview

  

The values in one of the fields in my GridView's table are just either a zero or a one or a null. Well, "zero," "one," and "" are not very appropriate values to display to the end user. Is there a way I could change these to "True"/"False"/"NA" or "Yes"/"No"/"NA"?


GridView - Change Row background every 3 rows

  

This should not be to hard but my head is not going for it today

I have a gridview that changes the sales reps name every 3 rows.

The data is group in 3 rows for each rep. estimates, job & invoices each have their own row

I want to change the backgroup for each rep.

I am using C# and I would guess it would be in the code behind file

I got this far but can not remember a way to check the next row to make sure

it is the same of changed from the previous row


protected void gvSaleReport_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
           string prevRep;
           prevRep = e.Row.Cells[0].Text;
           if (prevRep == e.Row.Cells[0].Text)
                e.Row.BackColor = System.Drawing.Color.Blue;
            else
                e.Row.BackColor = System.Drawing.Color.White;
        }
    }


Thanks



After one record is added can't add anymore records to GridView programmatically?

  

Hi Community

    I have a GridView that you can add a record to programmatically.

    The problem is that you can only add one record to the GridView after that
it will not accept anymore records. 

    The error is:

NullReferenceException was handled by user code
Object reference not set to an instance of an object.

     Below is the code:    

<body>
    <form id="form1" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>

     <asp:SqlDataSource
        ID="SqlDataSource1"
        runat="server" InsertCommandType="Text" OnInserting="SqlDataSource1_Inserting" OnInserted="SqlDataSource1_Inserted"
        ConnectionString="<%$ ConnectionStrings:ConnectionString4 %>"
        SelectCommand="SELECT [inFrmDate], [inFrmData], [id_num] FROM [tblIncomingForms]"
        InsertCommand="INSERT INTO [tblIForms] ([inFrmDate], [inFrmData]) VALUES (@inFrmDate, @inFrmData)"
        UpdateCommand="UPDATE [tblForms] SET [inFrmDate] = @inFrmDate, [inFrmData] = @inFrmData WHERE [id_num] = @id_num"
        DeleteCommand="DELETE FROM [tblForms] WHERE [id_num] = @id_num">
        
        <DeleteParameters>
            <asp:Parameter Name="id_num" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="inFrmDate" DbType="DateTime" />
            <asp:Parameter Name="inFrmData" Type="Int32" />
            <asp:Parameter Name="id_num" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter DbType="DateTime" Name="inFrmDate" />
            <asp:Parameter Name="inFrmData" Type="Int32" />
        </InsertParameters>
 </asp:SqlDataSource>
   
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
    DataSourceID="SqlDataSource1" DataKeyNames="id_num" ShowFooter="True"
        onselectedindexchanged="GridView1_SelectedIndexChanged"
            OnRowCommand="GridView1_RowCommand" Width="890px">
    <Columns>
   
        <asp:TemplateField HeaderText="Form in date">
    <ItemTemplate>
        <%# Eval("inFrmDate") %>
    </ItemTemplate>
   
    <EditItemTemplate>
        <asp:TextBox runat="server" ID="EditFormInDate" Text='<%# Bind("inFrmDate") %> ' />
    </EditItemTemplate>
    <FooterTemplate>
        <asp:TextBox runat="server" ID="InsertFormInDate" Text='<%# Bind("inFrmDate") %>' />
    </FooterTemplate>
    </asp:TemplateField>
    
 &nb

Record won't get added to Gridview programmatically

  

Hi Community

    In my table I have 3 fields:

 [inFrmDate] (this is the key field), [inFrmData], [totFrmData] (this accepts nulls)

When I try to add [inFrmDate], [inFrmData] to the GridView I get the message
to the effect that the:

    @inFrmDate scalar is not declared.

But as you can see from below it is declared: 

    <asp:SqlDataSource
        ID="SqlDataSource1"
        runat="server"
        ConnectionString="<%$ ConnectionStrings:nuConnectionString %>"
        SelectCommand="SELECT [inFrmDate], [inFrmData], [totFrmData] FROM [tblForms]"
        InsertCommand="INSERT INTO [tblForms] ([inFrmDate], [inFrmData], [totFrmData]) VALUES (@inFrmDate, @inFrmData, @totFrmData)"
        UpdateCommand="Update [tblForms] set inFrmData=@inFrmData, [totFrmData]=@totFrmData where [inFrmDate]=@totFrmDate"

        DeleteCommand="DELETE FROM [tblForms] WHERE [inFrmDate] = @inFrmDate">
        
    </asp:SqlDataSource>
   
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"
    DataSourceID="SqlDataSource1" DataKeyNames="inFrmDate" ShowFooter="true"
        onselectedindexchanged="GridView1_SelectedIndexChanged" OnRowCommand="GridView1_RowCommand">
    <Columns>
   
    <asp:TemplateField HeaderText="Form in date">
    <ItemTemplate>
        <%# Eval("inFrmDate") %>
    </ItemTemplate>
   
    <EditItemTemplate>
        <asp:TextBox runat="server" ID="EditFormInDate" Text='<%# Bind("inFrmDate") %> ' />
    </EditItemTemplate>
    <FooterTemplate>
        <asp:TextBox runat="server" ID="InsertFormInDate" Text='<%# Bind("inFrmDate") %>' />
    </FooterTemplate>
    </asp:TemplateField>
    
    <asp:TemplateField HeaderText="Number of Forms">
        <ItemTemplate>
            <%# Eval ("inFrmData") %>
        </ItemTemplate>
   
        <EditItemTemplate>
            <asp:TextBox runat="server" ID="EditNumberForms" Text='<%# Bind("inFrmData") %>' />
        </EditItemTemplate>
        <FooterTemplate>
            <asp:TextBox runat="server" ID="InsertNumberForms" Text='<% Bind("inFrmData") %>' />
        </FooterTemplate>
    </asp:TemplateField>
  
    <asp:TemplateField HeaderText="Commands">
        <ItemTemplate>
            <asp:Button runat="server" ID="Edit" Text="Edit" CommandName="Edit" />
            <asp:Button runat="server" ID="Delete" Text="Delete" CommandName="Delete" />
        </ItemTemplate>
        <EditItemTemplate>
            <asp:Button runat="server" ID="Update" Text="Update" CommandName="Update" />
     &nb

 
Categories:
.NET
Java
PHP
C/C++/VC++
HTML/XML
SAP
MainFrames
Data Warehousing
Testing
MySQL
SQL Server
Oracle
Javascript/VB Script
Others
Login
 
 
 
 
 Forgot password
 Contact Us   Terms Of use   Share your knowledge