Object looses a Cookie Value in Silverlight [Resolved]

Posted by Vuyiswamb under Silverlight on 5/14/2011 | Points: 10 | Views : 1157 | Status : [Member] [MVP] [Administrator] | Replies : 1
Good Day All

I have a strange situation here. When a user logs in i store the username or userid in the Cookie. So i have a generic method that retrieves that value and when i debug this, i can see that the value is retrieved nicely and i assign that value to a property like this

[code]ContactsModel model = new ContactsModel();
model.iUserid = Convert.ToInt32(GenericMethods.GenericMethods.GetCookie("UserID"));[/code]

and after that Asynchronously i call the Business Layer WCF Service

like this

[code]
business.AddContactNumberAsync(model);
business.AddContactNumberCompleted += new EventHandler<AddContactNumberCompletedEventArgs>(business_AddContactNumberCompleted);[/code]


and the Completed Event like this

[code]void business_AddContactNumberCompleted(object sender, AddContactNumberCompletedEventArgs e)
{
if (e.Error == null)
{
if (e.Result.ToString() == "")
{
lblError.Visibility = System.Windows.Visibility.Visible;
lblError.Content = "Successfully Added";
lblError.Background = new SolidColorBrush(Colors.Green);
this.DialogResult = true;
}
else
{
lblError.Visibility = System.Windows.Visibility.Visible;
lblError.Content = e.Result;//"Service not Available";
lblError.Background = new SolidColorBrush(Colors.Red);
}
}
else
{
lblError.Visibility = System.Windows.Visibility.Visible;
lblError.Content = e.Result; //"Service not Available";
lblError.Background = new SolidColorBrush(Colors.Red);

}
}[/code]

and in my Business Layer Service , i wanted to make if the value is corrupted in the Silverlight side or Business Layer side and i receive a call like this in the Business layere Service

[code]
public string AddContactNumber(ContactsModel Model)
{
string Error = string.Empty;

eCashDataLayer.IeCashDatalayerClient Datalayer = new IeCashDatalayerClient();

if (Model.iUserid != 0)
{
Error = Datalayer.AddContactNumber(Model);
}
else
{
Error = "Invalid Userid";
}

return Error;
}
[/code]

it always return "Invalid Userid" , i am not sure what is the problem because this has been working all along.

Thanks

Thank you for posting at Dotnetfunda
[Administrator]



Responses

Posted by: Vuyiswamb on: 6/5/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down

Resolved
My firewall had to do with this and the timeouts in the webconfig were invalid

Thank you for posting at Dotnetfunda
[Administrator]

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

Login to post response