hi
I want save data in session so I used below code:
UserData user = new UserData
{
Name = Txtname.Text,
State = DdlState.SelectedItem.Text,
City = DdlCity.SelectedItem.Text,
Mobile = TxtMob.Text,
Tell = txttell.Text,
Address = Txtaddu.Text,
PostCode = TxtcodeU.Text,
Email = TxtEmail.Text,
}
now I have radio button in page and I want if it checked it will save data in session:
UserData user = new UserData
{
Name = Txtname.Text,
State = DdlState.SelectedItem.Text,
City = DdlCity.SelectedItem.Text,
Mobile = TxtMob.Text,
Tell = txttell.Text,
Address = Txtaddu.Text,
PostCode = TxtcodeU.Text,
Email = TxtEmail.Text,
if (Rborder.Checked)
{ order = "Orderd"},
}
but this error happen:
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1525: Invalid expression term 'if'
can you help me?
Best regards
Neda