when i use the codings i have an error like not all code path return a value.how can i solve this
public
string
try{
if
{
companymailid = mailname;
Session["cmailid"] = companymailid;
Server.Transfer(
}
{
companymailid = "";
}
}
else return companymailid;}"mail.aspx");(mailname != null)companymailid;string mailid(string mailname){
Manikavelu VelayuthamPosted Mar 2, 2011, 6:31 AM
Try like this
public string test(){
try
{
return "";
}
catch{
return "";
}
}
Suthish NairPosted Mar 2, 2011, 12:56 PM
Jaganathan BantheswaranPosted Mar 2, 2011, 10:36 AM
Try this.
try
{
if(somecondition)
{
return something; //optional
}
else
{
return something; // optional
}
}
catch(Exception)
{
}
return something; //else error will raise.
the first two return statements are not considering in this case. because of its inside the if block.
karthi vimalaPosted Mar 2, 2011, 8:31 AM
ya,i specify false parameter in server.transfer("mail.aspx",false) and also for mail.aspx page i set enabledviewstate is false now also the same error will occur.
i didn't know why the error will occur.can anyone explain me why it will occur.
Suthish NairPosted Mar 2, 2011, 8:13 AM
Krishna GaradPosted Mar 2, 2011, 7:39 AM
karthi vimalaPosted Mar 2, 2011, 7:27 AM
i correct the previous error,by using session i pass the value to mail.aspx page when i execute this th error
Error executing child request for mail.aspx.
will occur,how can i solve this
here i attached my codings
VulpesPosted Mar 2, 2011, 6:27 AM