how to use HttpContext.GetGlobalResourceObject for gridview pagenumber

Posted by Skaftabali under ASP.NET on 10/30/2010 | Points: 10 | Views : 7135 | Status : [Member] | Replies : 2
Hi,

I have one gridview.In this gridview i use pagenumber for PageIndexChanging and also use footer for how many page is availabe.
i use like that for english site.

Gridview1_PageIndexChanging
{
if (ds.Tables[0].Rows.Count > 0)
{
Gridview1.DataSource = dt;
Gridview1.PageIndex = e.NewPageIndex;
Gridview1.DataBind();
}
}
Gridview1_RowDataBound
{
if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[0].Text = "Page" + (Gridview1.PageIndex + 1) + " of " + Gvstudremplan.PageCount.ToString();
}
}
so i want use for Arabic
how to put HttpContext.GetGlobalResourceObject
i use like that
if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[0].Text = (string)HttpContext.GetGlobalResourceObject("Homemaster", "strPage").ToString() + " " + (Gvstudremplan.PageIndex + 1) + (string)HttpContext.GetGlobalResourceObject("Homemaster", "strof").ToString() + " " + Gvstudremplan.PageCount.ToString();
}
its working but number is dispaly english not arabic.
pls give me proper solution.its very urgent.




Responses

Posted by: Poster on: 10/31/2010 [Member] Starter | Points: 25

Up
0
Down
The value written in the Global resources is in Arabic or English?

I think instead of using GlobalResources you should use LocalResources for localization.

Read these two articles on Localization.

http://www.dotnetfunda.com/articles/article356-developing-multilingual-web-application-in-net-i-.aspx
http://www.dotnetfunda.com/articles/article234.aspx

Hope this will help.

Skaftabali, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lalji_mer on: 10/31/2010 [Member] Bronze | Points: 25

Up
0
Down
Hi,

you will get some idea from this link

http://forums.asp.net/p/1455086/3335099.aspx

LP MER

Skaftabali, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response