|
Hi All,
i am developing one web application with two language in English and Arabic in my application i used master page and other pages are content pages i used Link Button for Language selection in master page i create BasePage.cs in App_Code the BasePage.cs code is
1 protected override void InitializeCulture()
2 {
3 string currentCulture = Convert.ToString(Session["userCulture"]);
4 if (!string.IsNullOrEmpty(currentCulture))
5 currentCulture = currentCulture;
6 else
7 currentCulture = "en-us";
8 Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(currentCulture);
9 Thread.CurrentThread.CurrentUICulture = new CultureInfo(currentCulture);
10
11 base.InitializeCulture();
12 }
i create Global.asax file also and the code for this is
void Session_Start(object sender, EventArgs e)
{
Session["MyCulture"] = "en-us";
}
in MasterPage.master i write the code for ButtonEvent for OnClick event and the code is
protected void changeCulture_Click(object sender, EventArgs e)
{
LinkButton senderLink = sender as LinkButton;
Session["userCulture"] = senderLink.CommandArgument;
Server.Transfer(Request.Path);
}
and i create the resource file for only one page that is orderonline page in Arabic and in English i put this file
in App_Resource folder and i make all pages derive from BasePage instead of Standard System.web.UI.Page
now my question is when i run this application and i try to click the Arabic or English Button to change the
language instead of generating the onclick event from the linkbutton simply its submitting form in orderonline.aspx which have resource file in App_Resource folder
if i open some other page like about us etc from this page i can easily change the language
where i am doing mistake i don't can any one help me for solving this problem
thank in advance for any help
|
|
|
|
|
Maybe you should use
Response.Redirect(Request.Url.ToString());
instead of using Server.Transfer(Request.Path);
Maybe you could also post you aspx code as the parts of yout aspx.cs code so we can see how it works.
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hi Everyone,
I have referred the below url and it works fine.
http://www.codeproject.com/KB/aspnet/RestServicesInASPNET2.aspx
Is there any video samples available. can anyone send me a link
Thanks in Advance.
Regards,
Manowj
|
|
|
|
|
If you have some query regrading any article, it always best to asked it in Article Discussion Section.
|
|
|
|
|
Hi,
It is not a query about article. I need more information about rest webservices with .Net2.0 attached samples.
Thanks in advance.
Regards,
Manowj
|
|
|
|
|
here is an sql query in which all fiels are correctly written-
(select admin.*, brok.FirstName+' '+brok.LastName as BrokerName
from adminmsgrecieved as admin,brokerdetails as brok
where admin.AdminId='111' and brok.BrokerId=admin.FromBrokerId ) as custo(AdminId,FromBrokerId,FromCustId,Subject,DateOfMsg,Message,Status,MsgId,BrokerName)
but i got an error "syntax error near as" what it may be??
plzz help.....
|
|
|
|
|
if you are concanating two columns then place it with in brakets
like
(brok.FirstName+' '+brok.LastName) as BrokerName
Hope this will work fine.
Rajeev Kr. Sharma
Sr. Software Engineer
E-Meditek Solutions Ltd.
http://www.emeditek.co.in/
|
|
|
|
|
No that is working fine.Problem is in "as custo(.....)".
|
|
|
|
|
Your SQL is broken. And so is your logic, this is not the SQL forum. Your from needs to be AFTER all the column specifications.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hi All,
I am doing save operation on button click.........after save successful i want to display one message to Save successful using how to do this please any one help me............
Thanks,
Amit
|
|
|
|
|
I use this code :
Alert class
using System.Web;
using System.Text;
using System.Web.UI;
public static class Alert
{
public static void Show(string message)
{
string cleanMessage = message.Replace("'", "\'");
string script = "<script type="text/javascript">alert('" + cleanMessage + "');</script>";
Page page = HttpContext.Current.CurrentHandler as Page;
if (page != null && !page.ClientScript.IsClientScriptBlockRegistered("alert"))
{
page.ClientScript.RegisterClientScriptBlock(typeof(Alert), "alert", script);
}
}
}
Now from Code-behind :
void btnSave_Click(object sender, EventArgs e)
{
try
{
SaveSomething();
Alert.Show("You document has been saved");
}
catch (ReadOnlyException)
{
Alert.Show("You do not have write permission to this file");
}
}
If you dont want all this, just use :
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "alertkey", "alert(\"Successfully saved.\");", true);
Hope this would help you.
|
|
|
|
|
If the save does a postback, then why do you need javascript ? If it doesn't, then I guess you need to throw a message into your AJAX code.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
how can i use asp button control in ajax accordion control
|
|
|
|
|
Perhaps you should look at this example.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi There,
I have a problem,I had written a java script funtion to retrieve key code value.When I press "." and "Delete" I am getting same keycode and Key char in Mozila 2.0.But this code is working fine in IE 6.0.Can anybody tell me how to diffrenciate between these two key as there is same keycode is present.
Thanks,
|
|
|
|
|
Try to search on google.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi
i have sample web form which have a gridView. also i add a DataSet to my web app and add some tables from server explorer to it as my dataSource.
my question is that how to set this DataSet object as dataSource for my gridView (in designTime) instead of using sqlDataSource ?
thanks
|
|
|
|
|
Use GridView DataSource Property.
|
|
|
|
|
Hi
as u can see in my question. i want to do this in design time.
|
|
|
|
|
Use
Gridview1.datasource = dataset1
gridview1.databind()
|
|
|
|
|
how can i find the difference between two calendar dates to calculate number of days and display it in a label.
|
|
|
|
|
TimeSpan difference = myFirstDate - mySecondDate;
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
thank you for replying
its showing an error "Error 3 Cannot implicitly convert type 'System.TimeSpan' to 'string'"
what should i do.
|
|
|
|
|
Mathew P V wrote: its showing an error "Error 3 Cannot implicitly convert type 'System.TimeSpan' to 'string'"
Eh?! You might like to read the MSDN documentation on TimeSpan to find out how it works and how to get data out of it.
No where in my advice would you have got the error above. Just blindly converting things to strings is often unwise.
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
thank you for the valuable reply,
i am new to asp.net. please give me some suggestions so that i can improve.
|
|
|
|