hi.. i have a small problem then i cant figure out. i have 2 sitemaps providers ( one for english and one for another language ). the files from english stay in "en" and the romanian language in "ro". i have 2 site.master pages. in the romanian page i put a button with the following code:
protected void Button1_Click(object sender, EventArgs e)
{
string url;
url = SiteMap.CurrentNode.Url.Replace(ResolveUrl("~/ro"), "~/en");
Response.Redirect(url);
}
so when i press the button it switches to the english files. my problem is with the button from the english page witch gives me an error. code for the english button:
protected void LinkButton1_Click(object sender, EventArgs e)
{
string url;
url = SiteMap.CurrentNode.Url.Replace(ResolveUrl("~/en/"), "~/ro/");
Response.Redirect(url);
}
so the problem is that it gives me this error :
" System.NullReferenceException: Object reference not set to an instance of an object "
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Site.LinkButton1_Click(Object sender, EventArgs e) in c:\Documents and Settings\Taz\My Documents\Visual Studio 2005\WebSites\test-mnir\Site2.master.cs:33
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +105
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
anyone has any clue to solution? thx for the help
protected void Button1_Click(object sender, EventArgs e)
{
string url;
url = SiteMap.CurrentNode.Url.Replace(ResolveUrl("~/ro"), "~/en");
Response.Redirect(url);
}
so when i press the button it switches to the english files. my problem is with the button from the english page witch gives me an error. code for the english button:
protected void LinkButton1_Click(object sender, EventArgs e)
{
string url;
url = SiteMap.CurrentNode.Url.Replace(ResolveUrl("~/en/"), "~/ro/");
Response.Redirect(url);
}
so the problem is that it gives me this error :
" System.NullReferenceException: Object reference not set to an instance of an object "
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Site.LinkButton1_Click(Object sender, EventArgs e) in c:\Documents and Settings\Taz\My Documents\Visual Studio 2005\WebSites\test-mnir\Site2.master.cs:33
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +105
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
anyone has any clue to solution? thx for the help